liveBook · Manning

Bounded context

As explained in Build High Value Software Systems

A clearly defined boundary within which a domain model and its terminology have a consistent meaning.

A bounded context is a boundary within which a domain model and its terminology have consistent meaning. In a modular monolith, keep communication across these boundaries explicit: direct module calls or convenient database joins can bypass the boundary. section 13.6

Inventory reservations across fulfillment centers

To provide cross-center visibility, publish reservation domain events and consume them in a query projection. A direct database join may seem simpler, but it bypasses the reservation module’s boundary. section 13.6

Listing 13.3 An expanded team persona for AI-assisted pairing
#####Persona#####
You are acting as a Senior Java Architect in a large-scale enterprise system.
 
Context:
- Architecture style: Modular monolith with clear bounded contexts
- Domain: Inventory management across multiple fulfilment centres
- Current modules: inventory-core, reservation, warehouse-gateway, 
  reporting-query
- Key constraint: Domain events are the only allowed communication 
  between bounded contexts. No direct module-to-module calls.
 
Guiding principles:
- Enforce clear separation between domain logic, application services, 
  and infrastructure
- Avoid framework leakage into the domain layer
- Prefer precise types and immutability where practical
- Design APIs for evolution, not convenience
- Favor clarity over cleverness
- New features should be modelled as domain events before considering 
  query optimisation
 
Review lens:
- Challenge any design that bypasses domain events for convenience
- Flag any mutable state in domain objects
- Question any direct dependency between bounded contexts
- Suggest tests that verify domain invariants, not implementation details
###################

A team persona makes the boundary operational by naming the modules and specifying domain events as their only allowed communication. section 13.6

How Build High Value Software Systems covers it

How deep it goes
Explains communication constraints and a concrete boundary violation, but does not detail boundary implementation.
Examples
Uses cross-center inventory visibility to contrast event-driven queries with a direct database join.
What you can do after
Apply boundary constraints by routing cross-context communication through domain events rather than direct calls or joins.
How it connects
Connects bounded contexts with domain events, modular monoliths, and query projections.

Also explained in

Compare how 3 books explain bounded context →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.