Source · Vlad Khononov, Learning Domain-Driven Design (O'Reilly)
Why this matters
Khononov, Learning Domain-Driven Design, Introduction & Part IMost large systems fail not because a framework was chosen badly but because the software's model drifts away from the business it is supposed to serve. Domain-Driven Design (DDD) treats that drift as the central risk. It says the hardest part of building software is not the code — it is understanding the problem deeply enough that the code can express it clearly.
DDD gives architects a shared vocabulary for aligning the model with the business, and a set of boundaries — ubiquitous language, bounded contexts, subdomains — that let a system grow without collapsing into a tangle where every concept means five different things depending on who you ask.
The concept
Khononov, Learning Domain-Driven Design, Ch. 1-3, 6-7A ubiquitous language is a rigorous, business-derived vocabulary shared by engineers and domain experts, used identically in conversation, documentation, and code. When a domain expert says 'policy' and the code says 'InsuranceContract', the language has already fractured.
A bounded context is the explicit boundary within which a particular model — and its ubiquitous language — is consistent and valid. The same term can mean different things in different contexts; the boundary is what keeps those meanings from bleeding into each other.
Khononov classifies subdomains into three kinds. A core subdomain is where the business differentiates itself — it is complex, changes often, and deserves your best engineers and richest modeling. A supporting subdomain is necessary but not a differentiator; simpler patterns suffice. A generic subdomain is a solved problem (authentication, payments) best bought or adopted off the shelf rather than built.
An aggregate is a cluster of entities and value objects treated as a single transactional consistency boundary, guarded by a root entity through which all external changes pass — enforcing the business rules (invariants) that must always hold true.
Worked scenario
Khononov, Learning Domain-Driven Design, Ch. 4 (Context Mapping)Imagine a logistics company. In the Sales context a 'Shipment' is a priced quote with a customer and payment terms. In the Routing context a 'Shipment' is a set of legs, carriers, and estimated transit times. Same word, two models — and that is fine, because each lives in its own bounded context.
Routing is where the company beats competitors on delivery speed, so it is a core subdomain: model it richly with aggregates that enforce invariants like 'a leg's origin must equal the previous leg's destination'. Billing is supporting — real but undifferentiated. Tax calculation is generic — buy it.
To connect Sales and Routing you draw a context map describing the integration relationship — perhaps Routing exposes a published, stable contract and Sales conforms to it (a Customer/Supplier or Conformist relationship), with an anti-corruption layer translating Sales concepts into Routing's language so neither model corrupts the other.
How it connects
Khononov, Learning Domain-Driven Design, Part III & Part IVBounded contexts are the natural seams along which you decompose a system into services — a lesson that reappears directly in The Hard Parts and in service-granularity decisions. Subdomain classification tells you where to invest architectural effort and where to keep things cheap.
DDD's strategic patterns (context maps, subdomains) feed evolutionary architecture: contexts define the modules whose coupling fitness functions can guard. And the tactical patterns — aggregates as consistency boundaries — anticipate the distributed-data and transaction problems you meet once contexts become separate deployables.
- Confusing bounded contexts with aggregates: a bounded context is a model/language boundary (often a whole service or module); an aggregate is a much smaller transactional consistency boundary inside a context.
- Assuming subdomains and bounded contexts map one-to-one. They often do not — a single bounded context can implement several subdomains, and the mapping is a design decision, not a given.
- Treating the ubiquitous language as documentation to write once. It is a living agreement; when the business language changes, the model and code must change with it or the language stops being ubiquitous.
- The ubiquitous language binds business experts and code to one vocabulary; a bounded context is the boundary within which that language stays consistent.
- Classify subdomains as core, supporting, or generic to decide where to invest deep modeling versus buy off the shelf.
- Aggregates are transactional consistency boundaries enforcing invariants through a root; context maps describe how contexts integrate.