Skip to contentSkip to content
0/47 chapters completed (0%)

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

#ChapterPatternsDifficulty~Time
01Foundations & Creational PatternsFactory, Builder, Singleton, PrototypeBeginner40 min
02Structural PatternsAdapter, Decorator, Facade, Proxy, Composite, BridgeIntermediate45 min
03Behavioral PatternsObserver, Strategy, Command, Chain of Responsibility, State, Template MethodIntermediate45 min
04Modern Application PatternsRepository, DI, Middleware, Circuit Breaker, RetryIntermediate40 min
05Distributed System PatternsCQRS, Event Sourcing, Saga, Strangler Fig, SidecarAdvanced45 min
06Anti-Patterns & Selection GuideGod Object, Golden Hammer, Cargo Cult + Decision MatrixIntermediate30 min

How Each Pattern Is Taught

Every pattern follows a consistent, practical structure:

  1. Real-world analogy — "think of it like..."
  2. The problem — a concrete scenario, not abstract theory
  3. Solution diagram — Mermaid class + sequence diagrams
  4. Go code — BEFORE (messy) → AFTER (with pattern applied)
  5. When to use / When NOT to use — the most valuable part
  6. Real-world usage — frameworks and libraries that use this pattern
  7. 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.

Built with VitePress + Dracula Theme