SOLID & Design Patterns Interview Question #68

What is Domain-Driven Design (DDD)?

Advanced Patterns, CQRS & Domain-Driven Design Fundamentals Mid-Level Intermediate

Quick Interview Answer

Domain-Driven Design is an approach to software development that emphasizes modeling complex business domains using concepts and language shared by developers and domain experts. It includes strategic concepts such as bounded contexts and tactical patterns such as entities, value objects, aggregates, and domain services.

Detailed Explanation

Domain-Driven Design is an approach to software development that emphasizes modeling complex business domains using concepts and language shared by developers and domain experts. It includes strategic concepts such as bounded contexts and tactical patterns such as entities, value objects, aggregates, and domain services.

DDD is most useful when business rules are complex enough to justify a rich domain model. Simple CRUD systems may not benefit from applying every DDD pattern.

Code Example

// Domain language appears directly in code:
order.AddItem(product, quantity);
order.ApplyDiscount(discount);
order.Confirm();

// Business behavior belongs with the
// domain concepts it governs.