Designpatterns
Behavioral patterns Command Iterator Observer Strategy Template method
Command Invoker: asks the command to carry out the request @CommandPattern.Invoker Command: defines an interface for executing an operation or set of operations @CommandPattern.Command Concrete command: implements the Command Interface to perform the operation. Typically acts as an intermediaryto a Receiver object. @CommandPattern.ConcreteCom mand Receiver: knows how to carry out the request @CommandPattern.Receiver
Iterator Iterator: Interface for accessing and traversing elements @IteratorPattern.Iterator Concrete Iterator: implements Iterator and keeps track of curren position @IteratorPattern.ConcreteIterator Aggregate: defines an interface for creating an iterator. @IteratorPattern.Aggregate Concrete Aggregate: hold the data. Implements the creation interface to manufacture an iterator @IteratorPattern.ConcreteAggregat e
Observer Subject: notifies Observers that some event has occurred. Keeps a subscription list and a means for modifying the list. Sometimes the Subject is an interface implemented by Concrete Subject. @ ObserverPattern.Subject Observer: defines an interface for notifying Observers @ ObserverPattern.Observer Concrete Observer: implements the Observer interface to do something when notified @ ObserverPattern.ConcreteObserv er
Strategy Strategy: interface that allows access to an algorithm @ StrategyPattern.Strategy Concrete Strategy: implemetsa particular algorithm to conform to the Strategy interface @ StrategyPattern.ConcreteStr ategy Context: uses the algorithm through the Strategy interface @ StrategyPattern.Context
Template method Abstract Class:defines an algorithm that uses primitive operations that are supplied by a subclass @ TemplateMethodPattern.AbstractClass Concrete Class: implements the Concrete Class: implements the primitive operations @ TemplateMethodPattern.ConcreteClass
Creational patterns Abstract Factory Singleton
Abstract Factory Abstract Factory: interface to the actual factory @AbstractFactoryPattern.Abstra ctfactory Concrete Factory: implements the AbstratFactory interface to create a specific class of object @ AbstractFactoryPattern. AbstractFactory Abstract Product: the sort of product that the Abstract Factory creates @ AbstractFactoryPattern. AbstractProduct Concrete Product: the actual object created by the factory @ AbstractFactoryPattern. ConcreteProduct
Singleton Singleton: the object being created; defines a class-level (static) get-instance method that returns the instance. The class-level get-instance may create the object if necessary @ SingletonPattern. Singleton
Structural patterns Adapter Composite Decorator Façade Proxy
Adapter Adaptee: an object that does not support the desired interface @ AdapterPattern. Adaptee Adapter: the class that makes the Adapteeappear to support the desired interface @ AdapterPattern. Adapter
Composite Component: an interface or abstract class that represents all objects in the hierarchy @ CompositePattern.Component Composite: a Component that can hold other Components. It doesn t know whether these subcomponents are other Composites or are Leaves @ CompositePattern.Composite Leaf: a Component that stands alone. @CompositePattern.Leaf
Decorator Component: an interface for objects that can have responsibilities added to them @ DecoratorPattern.Component Concrete Component: an object to whickadditional responsibilities or new behaviour is attached @ DecoratorPattern. ConcreteComponent Decorator: wraps a Component and defines an interface that conforms to the Componen sinterface but behaves differently @ DecoratorPattern.Decorator Concrete Decorator: extends the Decorator to define the additional behaviour @ DecoratorPattern. ConcreteDecorator
Façade Facade:provides a simple interface to a complex subsystem @ FacadePattern
Proxy Proxy: maintains a reference and controls access to the Real Subject. Implements the same interface as the Real Subject so it can be used in the place of the Real Subject @ ProxyPattern. Proxy Subject: an interface implemented by bththe Proxy and the Real Subject; allowed to use them interchangeably @ ProxyPattern.Subject Real Subject: the real object that the Proxy represents @ ProxyPattern.RealSubject Client: @ ProxyPattern.Client