Responsibility Layers

An advanced DDD pattern for organizing large domains into horizontal layers of increasing abstraction, where each layer expresses business intent at a different level — from concrete operational capabilities at the bottom to strategic decision support at the top.

Problem

In large, complex domains (logistics, financial systems, supply chain), a flat domain model becomes tangled: entities at all levels of abstraction (vehicles, shipments, delivery policies, contracts, optimization strategies) live side by side, making it hard to understand which rules live where and why. Conway’s Law suggests this leads to equally tangled teams and codebases.

Solution / Explanation

Responsibility Layers organizes the domain into horizontal strata where each layer only knows about the layers below it. Higher layers express intent; lower layers express mechanism.

Evans’ Five Layers

Eric Evans originally identified these five layers for the logistics domain, but the principle generalizes:

LayerPurposeExample (Logistics)Example (E-commerce)
Decision SupportAnalytics, optimization, recommendationsRoute optimization AIPricing strategy engine
CommitmentsContractual obligations and promisesDelivery commitment to customerOrder confirmation SLA
PoliciesBusiness rules and constraintsDelivery policy constraintsReturn policy rules
OperationsActive business processesCurrent shipment scheduleActive order fulfillment
CapabilitiesAvailable resources and skillsVehicle fleet, driver rosterWarehouse inventory, staff

Layer Rules

  1. Each layer depends only on layers below it — no upward dependencies
  2. Higher layers express intent (“we’ve committed to deliver this by Tuesday”)
  3. Lower layers express mechanism (“here are the available trucks and routes”)
  4. Domain events flow upward: a capability change (driver unavailable) propagates through operations (reschedule), policies (check SLA), commitments (update customer), and decision support (reoptimize)

Contrast with Technical Layered Architecture

This is not the same as the technical Layered Architecture pattern (Presentation → Application → Domain → Infrastructure).

AspectTechnical LayersResponsibility Layers
PurposeSeparate technical concernsSeparate domain abstraction levels
ContentCode/framework categoriesBusiness concepts at different granularity
DirectionTop-down call flowBottom-up event flow; top-down queries
ExamplesController → Service → RepositoryCommitments → Policies → Operations

Both can coexist: within each Responsibility Layer, you still use the technical layered architecture.

When to Apply

Apply when:

  • Your domain has multiple levels of abstraction (commitments vs. operations)
  • Business rules at one level need to be insulated from implementation details of lower levels
  • Domain is large enough that finding “where does this rule live?” is a daily question

Skip if:

  • Domain is small/simple — this pattern adds complexity that must be earned
  • Layers are not clearly distinguishable in your domain

Trade-offs

BenefitCost
Clear home for every business ruleRequires deep domain understanding to define layers correctly
Higher-level layers are stable; lower layers change moreInitial investment to identify correct layer boundaries
Reduces tangling of abstraction levelsAdds architectural ceremony
Enables independent evolution of commitment logic from capability logicTeams must coordinate on layer boundaries