Wzorce projektowe często pojawiają się poprzez refaktoryzację zamiast być zaprojektowane z góry — w miarę jak kod rośnie i jego potrzeby stają się jasne, refaktoryzacja w kierunku wzorców ulepsza projekt. To odzwierciedla zasadę stosowania wzorców, gdy rzeczywiście są potrzebne, a nie spekulacyjnie.
Wzorce pojawiają się poprzez refaktoryzację
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
