Volume I
The Library
The 23 Gang of Four design patterns, each as a chapter.
Creational
- Abstract FactoryCreate families of related objects that must be consistent.
- BuilderConstruct complex objects step by step, with a final validation.
- Factory MethodLet subclasses decide which concrete product to instantiate.
- PrototypeClone a pre-configured instance instead of building from scratch.
- SingletonGuarantee one instance of a class with a controlled access point.
Structural
- AdapterTranslate one interface into another the client already expects.
- BridgeSplit an abstraction from its implementation so both can vary.
- CompositeTreat single objects and groups of objects uniformly through a tree.
- DecoratorAdd responsibilities to an object dynamically by wrapping it.
- FacadeSimplify a complex subsystem behind one coherent interface.
- FlyweightShare intrinsic state across many instances to save memory.
- ProxyStand in for another object to control access to it.
Behavioral
- Chain of ResponsibilityPass a request along a chain until one handler takes it.
- CommandEncapsulate a request as an object, so it can be queued, logged, or undone.
- InterpreterEvaluate a small language by representing its grammar as classes.
- IteratorTraverse a collection without exposing its internal representation.
- MediatorCentralize many-to-many communication through one hub object.
- MementoCapture and restore an object's state without breaking encapsulation.
- ObserverNotify many subscribers automatically when a subject changes.
- StateChange an object's behavior as its internal state changes.
- StrategySwap interchangeable algorithms behind a common interface.
- Template MethodFix an algorithm's skeleton in a base class; let subclasses fill in steps.
- VisitorAdd operations across a type hierarchy without changing the types.