Design Patterns Course
Design Patterns: From Code Smells to Enterprise Architecture Mastery — GoF, SOLID, enterprise patterns and interview prep.
Enterprise learning path
Foundations & Code Smells
- 1Design Patterns HomeNext up
Welcome to Design Patterns: From Code Smells to Enterprise Architecture Mastery — a mentor-led course built for engineers who want judgment, not flashcards.
- 2What Are Design Patterns?
Design patterns are not code you copy — they are named structures that crystallize decades of hard-won engineering judgment.
- 3The Gang of Four Legacy
In 1994, four engineers — Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides — published Design Patterns: Elements of Reusable Object-Oriented Software.
- 4Why Patterns Are Not Silver Bullets
Every junior engineer who reads the GoF book wants to apply 23 patterns to their first project.
- 5Code Smells That Beg for Patterns
Code smells are Fowler's term for surface symptoms of deeper design problems.
- 6Recognizing Change Points
Change points are the heart of pattern selection.
- 7The Pattern Selection Framework
Pattern selection is where engineers most often lose composure — too many patterns, too many trade-offs, too much taste.
SOLID & OOP Thinking
- 8OOP Recap for Pattern Thinkers
Most OOP refreshers teach the four pillars as definitions.
- 9SOLID Principles Overview
SOLID is the five-principle discipline that makes object-oriented design tractable at scale.
- 10Single Responsibility in Practice
Single Responsibility sounds obvious and is the most violated principle in practice.
- 11Open/Closed Principle
Open/Closed is the principle Strategy, Factory Method, Decorator, and plugin systems implement: add new behavior by extending, not by editing stable code.
- 12Liskov Substitution
Liskov Substitution demands that subtypes honor the base contract.
- 13Interface Segregation
Interface Segregation splits fat interfaces so clients depend only on methods they use.
- 14Dependency Inversion
Dependency Inversion makes testing and infrastructure swaps possible.
- 15Composition Over Inheritance
Composition over inheritance is the modern default.
Creational Patterns
- 16Singleton Pattern
Singleton guarantees exactly one instance of a class per process and exposes a global access point.
- 17Singleton Pitfalls & Alternatives
The problem with Singleton isn't always "one instance" — that's often correct.
- 18Factory Method
Factory Method moves the decision of which concrete class to create out of the consumer and into a dedicated method.
- 19Abstract Factory
Abstract Factory produces a family of related objects designed to work together — not one product at a time.
- 20Builder Pattern
Builder turns long, error-prone constructor calls into readable, validated, step-by-step assembly.
- 21Prototype Pattern
Prototype creates new objects by cloning an existing instance rather than calling a constructor.
- 22Object Pool Pattern
Object Pool caps expensive resources alive at once and amortises construction cost.
- 23Dependency Injection vs Singleton
Dependency Injection vs Singleton clarifies an common confusion: DI and Singleton solve overlapping but distinct problems.
Structural Patterns
- 24Adapter Pattern
Adapter (Wrapper) bridges two incompatible interfaces.
- 25Facade Pattern
Facade hides complexity of a multi-class subsystem behind a small, purpose-built API.
- 26Decorator Pattern
Decorator wraps an object that shares its interface and adds behaviour before/after delegating to the original.
- 27Proxy Pattern
Proxy stands in for a real object and intercepts every call — same interface, different responsibilities.
- 28Composite Pattern
Composite lets a single object and a group share the same interface, so callers recurse a tree without caring whether a node is leaf or branch.
- 29Bridge Pattern
Bridge splits one class hierarchy into two independent axes: abstraction (what the client uses) and implementation (how work is done).
- 30Flyweight Pattern
Flyweight reduces memory by sharing one immutable instance among many logical objects.
- 31Structural Patterns in Microservices
Structural Patterns in Microservices maps GoF structural patterns onto network boundaries.
Behavioral Patterns
- 32Strategy Pattern
Strategy turns a conditional that selects an algorithm into a polymorphic call.
- 33Observer Pattern
Observer (Publish/Subscribe at object level) decouples event sources from handlers.
- 34Command Pattern
Command turns a method call into a first-class object you can store, queue, schedule, undo, log, or replay.
- 35State Pattern
State models a context that behaves differently depending on which state object it holds.
- 36Template Method
Template Method fixes the order of a multi-step algorithm in a base class and lets subclasses override variable steps.
- 37Iterator Pattern
Iterator separates traversal from storage.
- 38Chain of Responsibility
Chain of Responsibility arranges handlers in sequence; each handles the request or passes to next.
- 39Mediator Pattern
Mediator centralises conversation between colleagues.
- 40Memento Pattern
Memento powers undo, snapshotting, checkpointing, and save-game.
- 41Visitor Pattern
Visitor separates algorithms from the structures they operate on.
- 42Behavioral Patterns in Event Systems
Behavioral Patterns in Event Systems composes Observer, Command, State, Mediator, and Chain of Responsibility into coherent event-driven architecture.
Enterprise Architecture Patterns
- 43Layered Architecture
Layered Architecture stacks the application in horizontal layers — presentation, application, domain, infrastructure — each depending only on layers below.
- 44Hexagonal Architecture
Hexagonal Architecture (Ports and Adapters) puts domain at the center.
- 45Clean Architecture
Clean Architecture (Uncle Bob) codifies concentric layers: Entities → Use Cases → Interface Adapters → Frameworks.
- 46Repository Pattern
Repository mediates between domain and persistence with a collection-like interface: findById, save, delete — without exposing SQL, ORM, or table shapes.
- 47Unit of Work
Unit of Work tracks changes to multiple aggregates during a business transaction and commits them atomically.
- 48CQRS Pattern
CQRS (Command Query Responsibility Segregation) separates write model (commands, normalized, strict) from read model (queries, denormalized, fast).
- 49Event Sourcing
Event Sourcing persists state as a sequence of state-changing events — not current row snapshot.
- 50Saga Pattern
Saga manages distributed transactions as a sequence of local transactions with compensating actions on failure.
- 51Outbox Pattern
Outbox Pattern solves the dual-write problem: atomically persist business data and outgoing message in the same database transaction, then a relay process publishes to Kafka/SNS.
- 52Circuit Breaker
Circuit Breaker stops cascading failures when a downstream dependency is unhealthy.
- 53API Gateway Pattern
API Gateway is the single entry point for clients into microservices — routing, authentication, rate limiting, TLS termination, and request shaping.
- 54Backend for Frontend (BFF)
BFF (Backend for Frontend) provides a dedicated backend per client channel — mobile, web, partner — that aggregates microservices into the exact shape each frontend needs.
- 55Strangler Fig Pattern
Strangler Fig gradually replaces a legacy system by intercepting traffic at the edge — new routes go to the new system, unmatched routes fall through to legacy.
Refactoring & Anti-Patterns
- 56Refactoring to Patterns
Refactoring to Patterns (Joshua Kerievsky, 2004) inverts the GoF approach.
- 57When NOT to Use a Pattern
When NOT to use a pattern is the most under-taught topic in design patterns.
- 58Pattern Overengineering
Pattern overengineering is the senior tax on junior enthusiasm: every new wrapped in Factory, every interface with one implementation, 8-layer stacks before CRUD hits the database.
- 59Testing Pattern-Based Code
Testing pattern-based code reveals whether patterns helped or hurt.
- 60Patterns in Legacy Codebases
Patterns in legacy codebases is where seniors earn their keep: no tests, tangled dependencies, original authors gone, business can't stop shipping.
Interview Mastery
- 61Design Patterns Interview Strategy
Design patterns interviews at senior levels test judgment, not memorization.
- 62System Design + Patterns
System design + patterns is the layer above GoF: how patterns compose in distributed systems.
- 63Mock Interview: Creational
Mock interview: creational simulates a 45-minute senior loop on object-creation patterns.
- 64Mock Interview: Behavioral
Mock interview: behavioral focuses on collaboration patterns.
- 65Pattern Vocabulary Cheat Sheet
Pattern vocabulary cheat sheet — print, fold, review before senior interviews.
Real-World Architecture
- 66E-Commerce Checkout Architecture
E-commerce checkout is the canonical capstone — pricing, inventory, payment, fulfilment, notification, audit.
- 67Notification System Design
Notification system design tests Strategy + Factory + Observer + Outbox composition.
- 68Payment Gateway Integration
Payment gateway integration is highest-stakes pattern composition: money involved, partial failures unacceptable, vendor SDKs inconsistent, regional providers need fallbacks.
- 69Multi-Tenant SaaS Patterns
Multi-tenant SaaS requires tenant-aware routing, auth, data, config, billing, audit.
- 70Final Capstone Review
Final capstone review closes the course tying every lesson together.