Skip to the workspace
Pebellslearn by building
Patterns & Design Principles  ›  Capstone Project

Domain-Driven Design

DDD 16 minDomain-driven design shapes software around the business's own language, and splits a large domain into bounded contexts where each word has one precise meaning.

software architect / Domain-Driven Design

Explore each scene at your own pace.

01 · The rule

The rule

Domain-Driven Design

In a DabbaGo meeting, the sales lead says "an order is confirmed when payment clears". The kitchen manager says "no, an order is confirmed when the cook accepts it". The rider lead says "an order is done when I hand it over". They are all right, about different things. The code, meanwhile, has one Order class with 60 fields trying to satisfy all three, and every team is afraid to touch it.

The rule

Speak the business's language, and give each meaning its own boundary.

Domain-driven design (DDD) is an approach to building software for complicated businesses. Its core ideas:

  • Domain: the business area the software serves: taking lunch orders, cooking, delivering, paying kitchens.
  • Ubiquitous language: the words the business experts use, used exactly the same way in conversations, documents and code. If kitchens say "ticket", the code says Ticket, not OrderRecordV2.
  • Bounded context: a boundary inside which each word has one precise meaning and one model. Across boundaries, the same word may mean something else, and that is fine.

DabbaGo has at least three contexts:

Context "Order" there means Key fields
Ordering A customer's purchase items, price, payment status
Kitchen A cooking ticket dishes, cook, ready time
Delivery A drop-off address, rider, time window

Contexts talk through clear connections, often events. When a customer pays, Ordering publishes OrderPlaced with the order ID; Kitchen creates its own ticket from it, and Delivery creates its own drop.

Inside a context, DDD offers building blocks:

  • Entity: something with an identity that lasts, like a specific customer.
  • Value object: something defined only by its values, like an address or an amount of ₹180.
  • Aggregate: a cluster of objects changed together through one root, which protects the rules, such as "an order's total always equals the sum of its items".

Bounded contexts are also natural lines for team ownership and, later, for services. That is why architects care about DDD even before writing code.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.