🧩 Design Patterns Roadmap: code → service → system → AI

How patterns actually make you better

Patterns are a vocabulary for trade-offs, not templates to paste. For each one, learn: the problem (forces), the structure, where it already exists in Spring/Go stdlib/Kafka/K8s, when NOT to use it, and implement it once in Java and once in Go.

The pattern ladder

LevelNoteWeeks
1. Object design (GoF + SOLID)GoF Patterns (Java & Go)W1–W4
2. ConcurrencyConcurrency PatternsW2–W3, revisit W10
3. Application & domainEnterprise & DDD PatternsW5–W9
4. Distributed & cloudDistributed & Cloud PatternsW10–W18
5. AI & agentsAI & Agent PatternsW19–W22
AlwaysAnti-Patterns & Code Smellsevery code review

Weekly pattern kata (every Saturday, 90 min)

  1. Pick 2 patterns from this week’s list
  2. Implement each in Java and Go (≤ 60 lines each), with a test
  3. Find it in the wild: locate the pattern in Spring/JDK/Go stdlib/Kubernetes source and link the file in your note
  4. Apply it to Orbit (or explain why it doesn’t fit)
  5. Write “When NOT to use” in 3 bullets
  6. Log it in the table below
WeekPatternsFound in the wildOrbit usageDone
W1Strategy, FactoryComparator, BeanFactoryLLM provider adapters[ ]
W2Builder (+ Go functional options), ObserverRestClient.builder(), ApplicationListenerWorkflow builder, run events[ ]
W3Decorator (Go middleware), Adapterhttp.Handler chains, HandlerAdapterGateway middleware[ ]
W4State, Command, Template MethodThread.State, Runnable, JdbcTemplateStep state machine, step commands[ ]
W5Proxy, Chain of ResponsibilitySpring AOP, FilterChainProxyTool auth chain[ ]
W6Repository, Unit of Work, SpecificationSpring Data, Hibernate SessionWorkflow repo[ ]
W7Composite, Visitor → sealed + pattern matchingASTs, FileVisitorWorkflow DAG, expression AST[ ]
W8Interpreter, MementoSpELorbit-expr, run checkpoints[ ]
W9Ports & Adapters, Anti-corruption layer—Provider/tool integrations[ ]
W10Lease, Fencing token, Idempotent receiveretcd leases, Kafka producer IDsTask leasing[ ]
W11Outbox, Inbox, Competing consumersDebeziumEvent backbone[ ]
W12Saga, Compensating transaction, Process managerTemporalUC3 refunds[ ]
W13Leader election, Scheduler-agent-supervisorK8s leader electionEngine timers[ ]
W14CQRS, Materialized view, Event sourcing—Run history, search[ ]
W15Sidecar, Ambassador, OperatorEnvoy, controllersWorker pool operator[ ]
W16Gateway offloading, Valet key, Claim checkEnvoy, S3 presigned URLsUploads, large payloads[ ]
W17Queue-based load leveling, Throttling, BulkheadKEDA, resilience4jWorkers, per-tenant caps[ ]
W18Pipes & filters, Deployment stamps/cellsUnix pipesIngestion pipeline[ ]
W19Prompt chaining, Routing, Model cascade—UC1, UC8, gateway[ ]
W20RAG variants, Reranking, Semantic cache—UC2[ ]
W21ReAct, Plan-and-execute, Orchestrator–workers, SupervisorLangGraphUC4, UC11[ ]
W22Evaluator–optimizer, Guardrail sandwich, Dual LLM, HITL—UC3, UC7, UC12[ ]

Books

  • Head First Design Patterns 2e ⭐ · refactoring.guru ⭐ · Design Patterns (GoF, reference)
  • Patterns of Enterprise Application Architecture (Fowler) · Learning Domain-Driven Design (Khononov)
  • ⭐ Patterns of Distributed Systems (Unmesh Joshi): WAL, leases, high-water mark, quorum, generation clock
  • Microservices Patterns (Richardson) · Enterprise Integration Patterns (Hohpe) · Cloud Design Patterns (Microsoft Azure Architecture Center, free)
  • Concurrency in Go · Java Concurrency in Practice · Anthropic Building effective agents