optional-skills/creative/creative-ideation/references/methods/pattern-languages.md
Christopher Alexander et al., A Pattern Language (1977). 253 patterns for designing buildings, towns, rooms — structured as a generative grammar with explicit cross-references. Spawned the Gang of Four software design patterns (1994) and many domain adaptations.
A pattern has three parts:
A pattern language is a network of patterns at different scales, with explicit links: which patterns contain this one, which patterns complete it.
For texture. Real use means buying or borrowing the book.
The patterns are arguably true and arguably false; what matters is the form.
Iterator pattern (Gang of Four, 1994)
Context: a collection of objects must be traversable by client code.
Problem: client shouldn't need to know the internal structure (array vs tree vs linked list); collection shouldn't have traversal logic scattered across clients.
Solution: provide an Iterator object with next(), hasNext(), current() that encapsulates traversal state. Collection produces an Iterator on request.
Therefore: separate "what is being traversed" from "how it is traversed."
See also: Composite (tree traversal), Visitor (operations during traversal), Factory Method (producing the right Iterator).
Source: Alexander et al., A Pattern Language (Oxford UP, 1977); The Timeless Way of Building (Oxford UP, 1979). For software: Gamma et al., Design Patterns (Addison-Wesley, 1994).