Mapping Domain-Driven Design onto LVD Layers

A team adopting Domain-Driven Design usually hits the same awkward week. The workshops produced entities, value objects, repositories and services, and now somebody has to decide which folder each one lives in. Three developers give three answers. LVD offers a tie-breaker that has nothing to do with taste: ask how often each thing is likely to change.

Placement by rate of change

DDD's tactical patterns are the building blocks used inside a single bounded context. The book's claim is that their placement in LVD is not arbitrary. It falls out of volatility, and you can see it by walking through a ride-hailing service.

  • Fare, GeoPoint, Trip. A value object such as a fare, an entity such as a trip with its identity, the event that says a trip was requested, and the rule that a completed trip must have an end time all describe what the data is. They belong in Schema (L1).
  • Rounding a fare, converting kilometres to miles. Stateless calculations with no side effects go in Utils (L2).
  • Trip repository, payment-partner translator. Both deal with something outside your process, so they sit in Resources (L3). That includes the anti-corruption layer, which is simply a translator facing a foreign model.
  • Assign a driver, cancel a trip. Domain services, application services and the operations that change an aggregate are business behaviour. They go in Tools (L4).

Notice what the list does not need: a debate. Each placement can be defended by asking which kind of change would force an edit.

Why the mapping holds up

The book's argument is volatility alignment. Descriptions of data are structural, and structure changes rarely, which is why Schema carries the lowest coefficient, ν of about 0.3. Persistence and external integrations change at a moderate pace, whenever a database or a partner API evolves, around 0.6. What the system does with its data changes with every product iteration, around 0.8.

There is a second payoff. Classic DDD layering puts the domain model at the centre and has infrastructure and application code depend on it, never the other way round. LVD enforces the same direction by construction: Tools lean on Resources, which lean on Utils and Schema, and nothing leans upward. A trip definition can never import a database client, because the folder rules would not allow it.

In practice this means DDD's conceptual vocabulary and LVD's structural rules reinforce each other. DDD tells you what the pieces are called; LVD tells you where they live and what they may touch.

Not every subdomain earns the full treatment

DDD sorts a business into three kinds of subdomain. The core is what sets the company apart and justifies the most careful modelling. Supporting subdomains are necessary but not differentiating. Generic subdomains are solved problems that most firms buy rather than build.

The book ties this classification to how much LVD rigour to spend. A core domain deserves the full combination of the two approaches. A generic subdomain may need only a thin wrapper around a third-party service. For the ride-hailing service, the matching of riders to drivers is the core, so it gets rich schemas, careful invariants and well-bounded tools. Sending receipt emails is generic, so a small Resources adapter around an email provider is plenty.

That keeps the cost honest. LVD gives every layer a clear job, but nobody is asked to model a mailing service like a competitive advantage.

The takeaway

When DDD and LVD meet, the question "where does this go?" stops being a matter of opinion. Data shape goes down, outside-world access goes in the middle, business behaviour goes above that, and the rate of change is the argument you use to settle any dispute. Read on in aggregates and the Tools layer, see how the two approaches differ in LVD vs. Domain-Driven Design, and meet the bottom of the stack in the Schema layer.

What the book covers

  • A refresher on bounded contexts, context mapping, core, supporting and generic subdomains
  • The full pattern-to-layer correspondence, including invariants, anti-corruption layers and application services
  • The volatility argument behind each placement and the shared dependency direction
  • Aggregate roots as transaction boundaries in the Tools layer