Design Patterns: Head-first vs Emergent
summary
Compares using head‑first (apply patterns upfront) versus emergent design (let patterns arise via refactoring) and argues patterns should emerge from refactoring. Demonstrates refactoring a PHP 8 Formatter into CsvVisitor and XmlVisitor classes, adding a Visitor base class and a Visitable trait, using reflection and constructor property promotion, and replacing conditional explosion with double dispatch; runs tests after each step and shows fewer edits per new format and clearer responsibilities.
AI-written summary · about
chapters (8)
- 0:00Design pattern intro
- 3:11Pattern misuse reasons
- 7:12Refactoring as evolution
- 14:51Refactoring example
- 35:35Natural Visitor use
- 46:34When to use patterns
- 47:17Q&A
- 56:22Closing
related talks
50mEmergent Design
02h 14mDesign Patterns Workshop
40mBarely Enough Design
57mDesign Patterns - The Most Common Misconceptions (2 of N)
58mImmutable Patterns of System Design; From Monolith to Agentic AI
27mDesigning Even Larger (JavaScript) Applications
30mComponents, patterns and sh.t it’s hard to deal with
01h 29mArchitecture Beyond Clean & Hexagonal
