Design patterns

The Design patterns category contains design patterns that show some of the classic Gang of Four patterns.

Purpose

The following table lists each pattern in the Design patterns category and its purpose.
Pattern Purpose
Decorator The Decorator pattern adds responsibilities to an object dynamically, without changing its interface. The Decorator pattern acts as a wrapper because it implements the original interface, adds functionality, and delegates work to the original object. The Architectural Discovery algorithm identifies this pattern as consisting of two classes: Decorator and the wrapped Component.
Factory Method The Factory Method pattern defines an interface for creating objects. Each Factory Method pattern can define which class is instantiated based on the input parameters and specifics of the situation. The Architectural Discovery algorithm identifies this pattern as consisting of Creator, Concrete Creator, Product, and Concrete Product. The Creator specifies the interface for creating a Product. The Concrete Creator implements this interface by instantiating Concrete Product.
Marker The Marker pattern declares a semantic attribute of a class. The Architectural Discovery algorithm identifies Marker as a single empty interface without methods or constants.
Observer/Observable The Observer/Observable pattern communicates the changes in the state of an object to other system objects. The Architectural Discovery algorithm identifies this pattern as consisting of Observer and Observable. The Observable class maintains a list of Observer classes that are notified when a state change occurs.
Singleton The Singleton pattern ensures that a class allows only one object instance. The Architectural Discovery algorithm identifies Singleton as a class with a private constructor and a public static field or method that provides global access to the instance of a Singleton.
Utility The Utility pattern models a stateless utility function. The Architectural Discovery algorithm identifies Utility as a class with a private constructor that contains only static methods.
Visitor The Visitor pattern performs specific operations on the elements of an object structure. The Visitor pattern allows additional operations without changing the classes of the elements on which they operate. The Architectural Discovery algorithm identifies the Visitor pattern as consisting of Visitor, Concrete Visitor, Element (optional), and Concrete Element. The Visitor is an interface that declares the Visit operation for every element. The Concrete Visitor implements the Visitor interface and acts upon each Concrete Element.
Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.