Návrhové vzory často vznikají skrze refaktoring spíše než být navrženy od počátku — jak kód roste a jeho potřeby se stávají jasnými, refaktoring směrem k vzorům zlepšuje design. To odráží princip aplikace vzorů když jsou skutečně potřeba, ne spekulativně.
Vzory vznikají skrze refaktoring
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
