100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Domain-Driven Design (DDD)

AdvancedTechnique3.2K learners

Domain-Driven Design (DDD) is a software design approach, introduced by Eric Evans, that structures complex software around a deep model of the business domain it serves, using a shared "ubiquitous language" between developers and domain…

Definition

Domain-Driven Design (DDD) is a software design approach, introduced by Eric Evans, that structures complex software around a deep model of the business domain it serves, using a shared "ubiquitous language" between developers and domain experts.

Overview

DDD's central premise is that the hardest part of building complex software isn't technical implementation but correctly capturing the business domain's rules, terminology, and boundaries — so DDD pushes teams to collaborate closely with domain experts and encode that shared understanding directly into the code's structure and naming, an idea Evans called the "ubiquitous language." Rather than one monolithic model covering an entire business, DDD introduces "bounded contexts" — explicit boundaries within which a particular model and vocabulary are consistent, acknowledging that terms like "customer" may legitimately mean different things in billing versus support contexts. DDD also introduces tactical patterns for structuring code within a bounded context: entities (objects with persistent identity), value objects (defined purely by their attributes), aggregates (clusters of objects treated as a consistency boundary), and repositories (abstractions for retrieving and persisting aggregates). These tactical patterns are often implemented using object-oriented programming (OOP) and frequently draw on classic design patterns, but DDD's real emphasis is strategic — getting the domain boundaries and shared language right before worrying about implementation details. DDD is best suited to genuinely complex business domains with intricate rules, where the cost of modeling mismatches is high; for simple CRUD applications, its overhead (bounded contexts, ubiquitous language workshops, aggregate design) is often unnecessary. It has become closely associated with microservices architecture, since bounded contexts map naturally onto independently deployable services with clear ownership boundaries. It is often mentioned alongside SOLID Principles in this space.

Key Concepts

  • Ubiquitous language shared between developers and domain experts
  • Bounded contexts define explicit model and vocabulary boundaries
  • Tactical patterns: entities, value objects, aggregates, repositories
  • Strategic focus on correctly modeling business complexity
  • Introduced by Eric Evans in his 2003 book of the same name
  • Closely associated with microservices architecture design

Use Cases

Modeling complex business domains with intricate rules
Aligning cross-functional teams around shared domain terminology
Designing microservice boundaries around bounded contexts
Structuring large enterprise applications for long-term maintainability
Reducing miscommunication between business and engineering teams

Frequently Asked Questions

From the Blog