Design Patterns & SOLID
Design Patterns & SOLID
Section titled “Design Patterns & SOLID”A beginner-friendly guide to design patterns — reusable solutions to common software problems. Learn the Gang of Four patterns, SOLID principles, and when to apply them.
Learning Path
Section titled “Learning Path”flowchart TB Start[Start Here 🚀] --> Fundamentals[01. Fundamentals<br/>What & Why, OOP Refresher] Fundamentals --> SOLID[02. SOLID Principles<br/>S O L I D] SOLID --> Creational[03. Creational Patterns<br/>Object Creation] Creational --> Structural[04. Structural Patterns<br/>Object Composition] Structural --> Behavioral[05. Behavioral Patterns<br/>Object Interaction] Behavioral --> Practical[06. Practical Guide<br/>When to Use What] Practical --> Interview[07. Interview Prep<br/>Common Q&A]
style Start fill:#7c3aed,color:#fff style Fundamentals fill:#3b82f6,color:#fff style SOLID fill:#059669,color:#fff style Creational fill:#06b6d4,color:#fff style Structural fill:#f59e0b,color:#fff style Behavioral fill:#ef4444,color:#fff style Practical fill:#8b5cf6,color:#fff style Interview fill:#ec4899,color:#fffThe 3 Categories — At a Glance
Section titled “The 3 Categories — At a Glance”flowchart LR subgraph Creational["🏗️ Creational"] S1[Singleton]:::c F1[Factory Method]:::c AF[Abstract Factory]:::c B1[Builder]:::c P1[Prototype]:::c end subgraph Structural["🔧 Structural"] Ad[Adapter]:::s Dec[Decorator]:::s Fac[Facade]:::s Pr[Proxy]:::s Com[Composite]:::s end subgraph Behavioral["🔄 Behavioral"] Ob[Observer]:::b St[Strategy]:::b Cmd[Command]:::b It[Iterator]:::b Sta[State]:::b end classDef c fill:#06b6d4,color:#fff classDef s fill:#f59e0b,color:#fff classDef b fill:#ef4444,color:#fffAll Patterns — Quick Reference
Section titled “All Patterns — Quick Reference”| Pattern | Category | Purpose |
|---|---|---|
| Singleton | Creational | One global instance |
| Factory Method | Creational | Delegate object creation to subclasses |
| Abstract Factory | Creational | Families of related objects |
| Builder | Creational | Step-by-step object construction |
| Prototype | Creational | Clone existing objects |
| Adapter | Structural | Make incompatible interfaces work together |
| Decorator | Structural | Add behavior without changing the class |
| Facade | Structural | Simplified interface to a complex system |
| Proxy | Structural | Control access to another object |
| Composite | Structural | Treat individual & group objects uniformly |
| Bridge | Structural | Separate abstraction from implementation |
| Flyweight | Structural | Share data to save memory |
| Observer | Behavioral | One-to-many notifications |
| Strategy | Behavioral | Swap algorithms at runtime |
| Command | Behavioral | Encapsulate requests as objects |
| Iterator | Behavioral | Traverse collections without exposing internals |
| State | Behavioral | Change behavior when state changes |
| Template Method | Behavioral | Define skeleton, let subclasses fill details |
| Chain of Responsibility | Behavioral | Pass request along a chain of handlers |
| Mediator | Behavioral | Centralize communication between objects |
| Memento | Behavioral | Save & restore object state |
| Visitor | Behavioral | Add operations without changing classes |
Sections
Section titled “Sections”📖 01. Fundamentals
Section titled “📖 01. Fundamentals”🎯 02. SOLID Principles
Section titled “🎯 02. SOLID Principles”- Single Responsibility (S)
- Open/Closed (O)
- Liskov Substitution (L)
- Interface Segregation (I)
- Dependency Inversion (D)
🏗️ 03. Creational
Section titled “🏗️ 03. Creational”🔧 04. Structural
Section titled “🔧 04. Structural”🔄 05. Behavioral
Section titled “🔄 05. Behavioral”- Observer
- Strategy
- Command
- Iterator
- State
- Template Method
- Chain of Responsibility
- Mediator
- Memento
- Visitor