デザインパターンは、実際に自分が抱えている本物の問題を解決するときに価値を発揮します。しかし、適合しない場面で無理に当てはめると過剰設計を招きます。いつパターンを使う(そして使わない)かについての適切な判断は、パターンを知っていることと同じくらい重要です。
本物の問題に適合するときにパターンを使う
✓ When you have a problem a pattern is DESIGNED to solve (recognize the situation)
✓ When the pattern genuinely makes the code better (more flexible, maintainable, clear)
✓ When the added structure is JUSTIFIED by real needs (flexibility you'll actually use)
✓ When it improves communication (a well-known pattern others will recognize)
→ patterns are TOOLS for specific problems → apply them to the right problems
パターンを無理に当てはめない(過剰設計を避ける)
✗ DON'T add a pattern just to use it ("pattern for its own sake") → adds needless complexity
✗ DON'T over-engineer → patterns add abstraction/indirection; if you don't NEED it,
it's complexity for nothing
✗ Avoid premature abstraction → don't build flexibility you don't (yet) need (YAGNI)
✗ A simple, direct solution is often BETTER than a pattern-heavy one
→ over-using patterns makes code MORE complex and HARDER to understand (the opposite goal)
