DDD Overview

DDD Overview

Domain-Driven Design (DDD) is a way of modelling complex business software so the code looks like how domain experts talk about the business. Two halves: strategic (where the model lives) and tactical (what the model is made of).

Strategic DDD: structuring the system

How the system is divided into modelling territories.

Tactical DDD: building the model

The building blocks inside one bounded context.

What DDD is not

When DDD pays off

When DDD is overkill

Common confusions

Where to start

  1. Identify your bounded contexts — most projects only have a handful.
  2. Pick one context; nail the ubiquitous language with domain experts.
  3. Model aggregates small. Bigger aggregates always look easier and always cost more later.
  4. Use value objects ruthlessly. Replace str for emails, int for cents, with VOs that enforce invariants.
  5. Repositories last — once the model stabilises, persistence is the easy part.