Search This Blog

2009-04-17

Design patterns

Design patterns are recurring solutions to software design problems you find again and again in real-world application development. Patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges.

Creational PatternsAbstract Factory Creates an instance of several families of classesBuilder Separates object construction from its representationFactory Method Creates an instance of several derived classesPrototype A fully initialized instance to be copied or clonedSingleton A class of which only a single instance can exist

Structural PatternsAdapter Match interfaces of different classesBridge Separates an object’s interface from its implementationComposite A tree structure of simple and composite objectsDecorator Add responsibilities to objects dynamicallyFacade A single class that represents an entire subsystemFlyweight A fine-grained instance used for efficient sharingProxy An object representing another object

Behavioral PatternsChain of Resp. A way of passing a request between a chain of objectsCommand Encapsulate a command request as an objectInterpreter A way to include language elements in a programIterator Sequentially access the elements of a collectionMediator Defines simplified communication between classesMemento Capture and restore an object's internal stateObserver A way of notifying change to a number of classesState Alter an object's behavior when its state changesStrategy Encapsulates an algorithm inside a classTemplate Method Defer the exact steps of an algorithm to a subclassVisitor Defines a new operation to a class without change