Pattern |
Purpose |
|
Abstract Factory |
many "platforms", one interface for creating a family of products |
Builder |
parse a complex representation, create one of several targets |
Factory Method |
dynamic (decoupled) creation through inheritance |
Prototype |
dynamic (decoupled) creation through delegation |
Singleton |
single instance enforcement, lazy initialization, global access |
|
|
Adapter |
impedance-match a legacy component to a new system |
Bridge |
decouple interface from implementation; move beyond encapsulation to insulation |
Composite |
recursive composition by coupling the aggregate class to a common abstraction |
Decorator |
recursive wrappering that supports client-specified incremental embellishment |
Facade |
simple wrapper (or surrogate) to a complicated subsystem |
Flyweight |
use sharing to optimize the use of lots of "little" objects |
Proxy |
use an extra level of indirection to support distributed, controlled, or intelligent access |
|
Chain of Respon |
OO linked list; launch-and-leave requests with a simple processing pipeline |
Command |
OO callback; promote a method invocation on an object to "full object status" |
Interpreter |
map: domain => language => grammar => hierarchical OO design |
Iterator |
an interface that supports the decoupling of algorithms and data structures |
|
Mediator |
decouple many peers by promoting many-to-many relationships to "full object status" |
Memento |
OO undo/rollback; externalize an object's state to an opaque object |
Observer |
decouple independent sender (model) from dependent receivers (views) |
State |
OO finite state machine; state inheritance hierarchy, current state wrapper |
Strategy |
legoware algorithm; publish interface in a base class, bury impl in derived classes |
Template Method |
common algorithm and placeholders in base class, variable steps in derived classes |
Visitor |
open for extension, closed for modification; add methods w/o changing existing classes
|