![]() |
|
| Summary of common Design Patterns | |
|
Strategy -- defines a family of algorithms , encapsualtes each one, and makes them interchangeable. It letss the algorithm vary independently from the client. Observer -- defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updates automatically. Decorator -- attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. Factory -- defines an interface for creating an object, but lets subclasses decide which class to instantiate. Abstract Factory -- provides an interface for creating families of related or dependent objects without specifying their concrete classes. Singleton -- ensures that a class has only one instance, and provides a global point of access to it. Command -- encapsulates a request as an object, thereby letting you parameterize other objects with different requests, and support undoable operations. Adapter -- converts the interface of a class into another interface the client expects. Template -- defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Iterator -- provides a way to access the elemtns of an aggregate object sequentially without exposing its underlying representation. Composite -- allows you to compose objects into tree structures to represent part-whole hierarchies, and to treat these compositions uniformly. State -- allows an object to alter its behavior when its internal state changes. Proxy -- provides a surrogate or placeholder for another object to control access to it. |