Design patterns often emerge through refactoring rather than being designed upfront — as code grows and its needs become clear, refactoring toward patterns improves the design. This reflects the principle of applying patterns when actually needed, not speculatively.
Patterns emerge through refactoring
Rather than designing patterns in UPFRONT (often premature/speculative), patterns often
emerge as you REFACTOR existing code:
→ start SIMPLE → as needs become clear (real complexity, real duplication, real change
points), REFACTOR toward a pattern that addresses them
→ "refactor TO a pattern" when the code would genuinely benefit
→ patterns as a destination of refactoring, not a starting blueprint
