DDD Lab
Learn Domain-Driven Design by playing. 12 interactive lessons, 96 practice questions with C# examples, a building block sorter and a glossary.
Domain-Driven Design explained, with C# examples
DDD Lab teaches Domain-Driven Design through 12 interactive lessons, 96 practice questions, a building block sorter game and a glossary. It covers strategic design, tactical patterns and how to implement DDD in .NET with EF Core. It suits developers and architects preparing for interviews or applying DDD at work.
Strategic design
- Ubiquitous language: one vocabulary for experts and code.
- Bounded contexts: where a model and its language stay consistent.
- Subdomains: core, supporting and generic, and where to invest.
- Context mapping: partnership, shared kernel, customer-supplier, conformist, anti-corruption layer, open host service, published language and separate ways.
Tactical design
- Entities and value objects with C# records
- Aggregates, roots and invariants, with design rules for small aggregates
- Domain events, integration events and the transactional outbox
- Repositories, factories, domain services and application services
- DDD in .NET: Clean Architecture layers and EF Core mapping of aggregates and value objects
Frequently asked questions
What is Domain-Driven Design?
Domain-Driven Design (DDD) is an approach to building software for complex business domains. Developers and domain experts build a shared model and a ubiquitous language, split the system into bounded contexts and express business rules directly in the code.
What is a bounded context in DDD?
A bounded context is a boundary inside which one model and its language stay consistent. The same word, such as Product or Customer, can mean different things in different bounded contexts, and each context has its own model.
What is the difference between an entity and a value object?
An entity has an identity that stays the same while its attributes change, such as a customer. A value object has no identity and is defined only by its values, such as Money or an address. Value objects should be immutable.
What is an aggregate in DDD?
An aggregate is a cluster of objects that are changed together as one unit. Its root is the only entry point and enforces the business invariants. Aggregates should be small and reference other aggregates by identity.
What is the difference between a domain event and an integration event?
A domain event records something that happened inside a bounded context, such as OrderPlaced. An integration event is published to other bounded contexts as a stable, versioned contract, often through a message broker and a transactional outbox.
When should you not use DDD?
Tactical DDD patterns add little value to simple CRUD areas with few business rules. Use rich modeling for complex, valuable subdomains, while strategic ideas such as ubiquitous language and bounded contexts help almost everywhere.
Progress, XP and badges are saved in your browser only.