23/23
- Patterns 5 minAbstract Factory
Whole families that must match — and the cost of adding one more kind of thing.
- Patterns 6 minAdapter
Making an incompatible interface fit — and the one file that should know the vendor's vocabulary.
- Patterns 6 minBuilder
Assembling a complicated object step by step — and the validation you can only do at the end.
- Patterns 5 minChain of Responsibility
Pass the request along until somebody claims it — and the case nobody handles.
- Patterns 6 minComposite
Treating one thing and many things identically — and the method that does not belong on a leaf.
- Patterns 6 minDecorator
Adding behaviour by wrapping rather than subclassing — and why the order of the wrappers is a real decision.
- Patterns 6 minFactory Method
Letting a subclass decide what to construct — and why a plain function is usually enough.
- Patterns 5 minFlyweight
Sharing the heavy part between many objects — and the split that makes it possible.
- Patterns 5 minInterpreter
A grammar as a class hierarchy — and why you should almost always use a parser generator instead.
- Patterns 6 minIterator
Walking a collection without knowing its shape — and why laziness is the part that matters.
- Patterns 5 minMemento
A snapshot that only its owner can read — and why undo usually wants commands instead.
- Patterns 6 minObserver
One-to-many notification without the sender knowing who is listening — and the leak it invites.
- Patterns 5 minPrototype
Copying an existing object instead of constructing one — and the depth of the copy.
- Patterns 6 minProxy
A stand-in with the same interface — and the fact that callers cannot tell is both the feature and the hazard.
- Patterns 6 minSingleton
One instance, globally reachable — and why the second half of that is the problem.
- Patterns 6 minState
Behaviour that follows the mode — and how the illegal transitions stop being reachable.
- Patterns 6 minStrategy
The algorithm as a parameter — and why in most languages it is now just a function.
- Patterns 5 minTemplate Method
The skeleton fixed, the steps varied — inheritance's one genuinely good use, and its limits.
- Patterns 6 minVisitor
Adding an operation without editing the classes — and the price it charges for that.