Design Patterns
Practical patterns every engineer should know — from classic GoF to modern distributed system patterns.
What You'll Master
Learn 27 design patterns through real-world analogies, BEFORE/AFTER Go code, Mermaid diagrams, and practical guidance on when to use (and when NOT to use) each pattern.
The Learning Path
| # | Chapter | Patterns | Difficulty | ~Time |
|---|---|---|---|---|
| 01 | Foundations & Creational Patterns | Factory, Builder, Singleton, Prototype | Beginner | 40 min |
| 02 | Structural Patterns | Adapter, Decorator, Facade, Proxy, Composite, Bridge | Intermediate | 45 min |
| 03 | Behavioral Patterns | Observer, Strategy, Command, Chain of Responsibility, State, Template Method | Intermediate | 45 min |
| 04 | Modern Application Patterns | Repository, DI, Middleware, Circuit Breaker, Retry | Intermediate | 40 min |
| 05 | Distributed System Patterns | CQRS, Event Sourcing, Saga, Strangler Fig, Sidecar | Advanced | 45 min |
| 06 | Anti-Patterns & Selection Guide | God Object, Golden Hammer, Cargo Cult + Decision Matrix | Intermediate | 30 min |
How Each Pattern Is Taught
Every pattern follows a consistent, practical structure:
- Real-world analogy — "think of it like..."
- The problem — a concrete scenario, not abstract theory
- Solution diagram — Mermaid class + sequence diagrams
- Go code — BEFORE (messy) → AFTER (with pattern applied)
- When to use / When NOT to use — the most valuable part
- Real-world usage — frameworks and libraries that use this pattern
- Related patterns — cross-references within the handbook
Why This Section Exists
Design patterns are distilled engineering wisdom — recurring solutions to common problems. But most resources teach them as abstract theory. This section takes a different approach:
- Practical first: every pattern starts with a real problem you've faced
- Go-idiomatic: patterns adapted for Go (channels, interfaces, functional options)
- Honest trade-offs: we tell you when a pattern is overkill or harmful
- BEFORE/AFTER code: see the messy code first, then the clean solution
Total: 27 patterns across 6 chapters · ~4 hours
Inspired by Refactoring.Guru, Head First Design Patterns, and the Go community's practical approach to software design.

Comments powered by Giscus. Enable GitHub Discussions on the repo to activate.