In a large system, different teams describe the same thing differently: for sales a “customer” is a legal entity with a contract and a discount, for support it is a person with a ticket. A bounded context draws such a boundary: within it its own model and its own ubiquitous language apply, and between contexts the model is translated explicitly.
What defines the boundary
The boundary is set not by lines of code but by three things: which team works with the model, which piece of code belongs to it and where that model is applied. Within the boundary the model must be coherent — with no contradictions between terms. Fully unifying the model of a large system is impossible and too costly, so it is deliberately divided into contexts. The main factor behind the boundary is human: a different model is needed wherever the team’s language changes.
One term, one meaning
Consider an online shop: the same words live in three contexts and mean different things.
| Term | Sales | Support | Delivery |
|---|---|---|---|
| customer | a legal entity with a contract and a discount | a person with an open ticket | the address and recipient of a parcel |
| order | a deal with a basket and payment | the source of a ticket | a parcel with a tracking number |
Because of this, a single company-wide “customer service” often fails: neighbouring contexts end up with different models of the same concept. Instead of a shared store, they need explicit translation at the boundary — for example, an exchange of events.
How contexts are joined
The connections between contexts are drawn on a context map: which contexts border which and how they translate their models. Typical ways of joining: a small fragment of the model that both contexts maintain together — the shared kernel, which Evans advises keeping small; a translator at the boundary that keeps a foreign model out — the anti-corruption layer; and an exchange of events. Microservices often coincide with contexts in their boundaries, but these are different concepts: a context is about the model, a service is about deployment.
The term was introduced by Eric Evans in the book Domain-Driven Design (2003): bounded context opens the part on strategic design — working with large models and teams.
Sources
the term is written from these pagesVerified 8 Nov