Design Patterns
The Gang of Four patterns in one line each.
Creational
- Singletonexactly one instance
- Factory Methodsubclass decides the type
- Abstract Factoryfamilies of matching objects
- Builderstep-by-step complex construction
- Prototypeclone an existing object
Structural
- Adaptermake interfaces compatible
- Decoratoradd behavior by wrapping
- Facadesimple front over a subsystem
- Proxystand-in that controls access
- Compositetreat groups and items alike
- Bridge / Flyweightdecouple / share state
Behavioral
- Strategyswappable algorithms
- Observernotify dependents (pub/sub)
- Commandaction as an object (undo)
- Statebehavior changes with state
- Template Methodfixed skeleton, custom steps
- Chain of Responsibilitypass request along handlers
- Iterator / Mediator / Visitor / Mementotraverse / centralize / add ops / snapshot