Architecture, tested against what actually shipped.

Ten concepts are each explained from their canonical source: Meyer, Fowler, the Gang of Four, Nygard, Richardson, and the W3C. Each concept is then checked against a real eleven-service distributed estate to see how far the implementation actually got.

Most architectural documentation stops at the definition. However, practical engineering exists in the gap between a theoretical pattern and the actual code. Each page in this section defines the strict pattern requirements. Next, it identifies exactly where the production system differed.

10concepts
7verified in production
3prescriptive
30+canonical citations

How to read this

Verified

The page describes something that existed in the codebase, with the structural evidence that settles it. Claims are bounded, not inflated.

Prescriptive

The pattern was absent from the estate. These pages are “what to do next”, and say so plainly rather than implying credit.

The gap

Every page names what the canonical definition requires that the common implementation omits. That gap is the actual lesson.

Hard lessons

6 concepts

Patterns that were reached for and half-landed. Each of these was measured in a real codebase, and in every case the dir structure claimed more than the implementation delivered. This discrepancy is the most common way these patterns fail.

HARD LESSON 01

CQRS vs CQS

Two packages named command/ and query/, one JPA entity behind both. Three mechanical tests separate genuine CQRS from an organisational split, plus Fowler’s own caution about when not to reach for it.

VerifiedJavaFowlerMeyer
Read
HARD LESSON 02

Message Brokers vs Event Buses

Redis pub/sub is fire-and-forget: no persistence, no replay, no consumer groups. What at-most-once really costs, and what a team had to hand-build above it to get delivery guarantees back.

VerifiedKafkaRabbitMQRedis
Read
HARD LESSON 03

Strict Smart/Dumb Components

Presentational components that import a global store lose their presentational nature. Composables often introduce a hidden state leak into these components, a structural flaw that prompted the pattern’s original author to revise his recommendation.

VerifiedVue 3PiniaTypeScript
Read
HARD LESSON 04

Strategy Pattern & Dependency Inversion

A Context holding concrete types is not Strategy, and an interface beside its only implementation is indirection, not inversion. One service contained a textbook-perfect instance and a broken one, 200 lines apart.

VerifiedJavaGoFSOLID
Read
HARD LESSON 05

Compile-time vs Runtime DTO Mapping

Reflection-based mapping turns a renamed field into a production incident; annotation processing turns it into a build error. Plus why reusing one DTO for request and response guarantees churn.

VerifiedMapStructJava
Read
HARD LESSON 06

Defense in Depth

UI permission filtering is a usability affordance, never a security control. Where authorization has to live, how to enforce it at the API boundary, and how to constrain the presentation layer safely.

VerifiedSpring SecurityOWASP
Read

Distributed systems essentials

4 concepts

Patterns the estate did not have. Each concept answers a problem the pages above prove the system had. These are prescriptive: what to build next, and what it costs.