--- id: [[P-Reinforce|P-Reinforce]]-AUTO-OODP-001 category: Unified confidence_score: 0.97 tags: [auto-reinforced, software-engineering, oop, [[Architecture|Architecture]]] last_reinforced: 2026-04-20 --- # [[Object-Oriented-Design-Patterns|Object-Oriented-Design-Patterns]] ## πŸ“Œ ν•œ 쀄 톡찰 (The Karpathy Summary) > "κ²€μ¦λœ μ„€κ³„μ˜ 악보: ν΄λž˜μŠ€μ™€ 객체 κ°„μ˜ 관계λ₯Ό κ΅¬μ‘°ν™”ν•˜μ—¬ λ³€κ²½μ—λŠ” μœ μ—°ν•˜κ³  ν™•μž₯μ—λŠ” μ—΄λ € μžˆλŠ” μ†Œν”„νŠΈμ›¨μ–΄λ₯Ό λ§Œλ“œλŠ” 23개 μ΄μƒμ˜ 고전적 해법." ## πŸ“– κ΅¬μ‘°ν™”λœ 지식 (Synthesized Content) 객체지ν–₯ λ””μžμΈ νŒ¨ν„΄(OODP)은 1994λ…„ GoF(Gang of Four)에 μ˜ν•΄ μ •λ¦½λœ, 객체지ν–₯ μ„€κ³„μ—μ„œ 자주 λ°œμƒν•˜λŠ” λ¬Έμ œλ“€μ— λŒ€ν•œ λͺ¨λ²” 사둀(Best Practices)μž…λ‹ˆλ‹€. 1. **3λŒ€ λΆ„λ₯˜**: * **생성 νŒ¨ν„΄ (Creational)**: 객체 생성 방식을 좔상화 (Singleton, Factory Method, Abstract Factory, Builder, Prototype). * **ꡬ쑰 νŒ¨ν„΄ (Structural)**: 클래슀/객체λ₯Ό 더 큰 ꡬ쑰둜 μ‘°ν•© (Adapter, Composite, Decorator, Facade, Proxy). * **ν–‰μœ„ νŒ¨ν„΄ ([[Behavior|Behavior]]al)**: 객체 κ°„μ˜ μ•Œκ³ λ¦¬μ¦˜ 및 μ±…μž„ λΆ„λ°° (Observer, [[Strategy|Strategy]], [[State|State]], Command, Visitor, Mediator). 2. **핡심 μ² ν•™ (SOLID & Composition Over Inheritance)**: * μƒμ†λ³΄λ‹€λŠ” ꡬ성을 μ‚¬μš©ν•˜κ³ , κ΅¬ν˜„μ΄ μ•„λ‹Œ μΈν„°νŽ˜μ΄μŠ€μ— 맞좰 ν”„λ‘œκ·Έλž˜λ° 함. 3. **νŒ¨ν„΄μ˜ κ°€μΉ˜**: * 개발자 κ°„μ˜ 곡톡 μ–Έμ–΄ 제곡, μ½”λ“œ μž¬μ‚¬μš©μ„± μ¦λŒ€, μœ μ§€λ³΄μˆ˜ λΉ„μš© 절감. ## ⚠️ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & RL Update) - **κ³Όκ±° λ°μ΄ν„°μ™€μ˜ 좩돌**: κ³Όκ±°μ—λŠ” '싱글톀(Singleton)'을 만λŠ₯ λ„κ΅¬μ²˜λŸΌ μΌμœΌλ‚˜, ν˜„μž¬λŠ” μ „μ—­ μƒνƒœλ₯Ό λ§Œλ“€μ–΄ λ‹¨μœ„ ν…ŒμŠ€νŠΈλ₯Ό μ–΄λ ΅κ²Œ λ§Œλ“œλŠ” 'μ•ˆν‹° νŒ¨ν„΄'으둜 μ§€λͺ©λ˜κΈ°λ„ 함 (μ˜μ‘΄μ„± μ£Όμž…-DI둜 λŒ€μ²΄ ꢌμž₯). - **μ •μ±… λ³€ν™”(RL Update)**: ν˜„λŒ€μ˜ ν•¨μˆ˜ν˜• ν”„λ‘œκ·Έλž˜λ°(FP) νŒ¨λŸ¬λ‹€μž„μ΄ ν™•μ‚°λ˜λ©΄μ„œ, λ³΅μž‘ν•œ μƒνƒœ νŒ¨ν„΄μ΄λ‚˜ μ „λž΅ νŒ¨ν„΄ λŒ€μ‹  λ‹¨μˆœν•œ κ³ μ°¨ ν•¨μˆ˜(Higher-order functions)λ₯Ό μ‚¬μš©ν•˜λŠ” 'νŒ¨ν„΄μ˜ κ²½λŸ‰ν™”' 정책이 μ„ ν˜Έλ¨. ## πŸ”— 지식 μ—°κ²° (Graph) - **Related**: Design Patterns, Clean Code, [[Separation_of_Concerns|Separation_of_Concerns]], Software Architecture, [[Component_Design_Patterns|Component_Design_Patterns]] - **Modern Tech/Tools**: InversifyJS (DI), Reactive Extensions (Observer). ---