DDD judged by its own standards: Why its core terms fail | heise online

DDD judged by its own standards: Why its core terms fail

Domain-driven design says to speak the language of software users. Yet its best-known terms don’t meet that standard.

listen Print view
A desk covered with various documents and colorful sticky notes.

(Image: sabthai / Shutterstock.com)

20 min. read
By
  • Golo Roden
Contents

Domain-driven design has one rule that stands above all others: Use the language of the people who use the software, not artificial, technical language. In mid-November, I applied that rule to DDD itself at the Software Architecture Gathering 2026 in Berlin. It became clear that some of its best-known terms would never have passed that test. “Ubiquitous Language”, “Bounded Context”, “Aggregate”: By DDD’s own standards, every one of them is exactly the kind of jargon DDD warns against.

This article is the written version of my talk, for everyone who couldn’t be in the room. Its title, “If You Apply DDD to DDD, You Won’t Get DDD”, may sound familiar: A year ago, an article with the same title appeared here, in German: Apply DDD to DDD, and no domain-driven design is left. It examined how DDD’s vocabulary puts people off and how its patterns became a refuge from the very human work they were supposed to support. The talk took that idea further, term by term.

First, a confession: I like DDD. What follows is criticism from within, not from the outside. And it starts with a simple question: Who actually uses DDD?

If you boil domain-driven design down to a single sentence, it comes down to this rule: Listen to the people who work with the software, use their words, and resist the temptation to impose a technical vocabulary on their domain. Everything else — the patterns, building blocks and diagrams — comes afterward.

the next big thing – Golo Roden
the next big thing – Golo Roden

Golo Roden is the founder and CTO of the native web GmbH. He works on the design and development of web and cloud applications and APIs, with a focus on event-driven and service-based distributed architectures. His guiding principle is that software development is not an end in itself, but must always follow an underlying technical expertise.

Now for a thought experiment: DDD is a product, too, and it has users. So what happens when DDD has to follow its own rule?

First, who are these users? For your software, they’re subject matter experts, such as people in sales, in claims processing, or at the checkout desk of a public library. Their language matters. For DDD, by contrast, the users are developers, because they have to apply it every day.

Technical terms aren’t foreign words to them; they’re everyday tools of the trade. The words that feel foreign are the ones they encounter only in books. By DDD’s own logic, then, developers' language should win out — not the language of consulting firms or of authors of technical books.

If DDD had followed this rule, many of its core terms would never have made it into the canon. I’ll take a closer look at three of them below. Anyone who put one of these terms into a domain model would be sent straight back to the drawing board at any decent DDD workshop.

“Ubiquitous” means present everywhere, found everywhere. It’s a perfectly good word, but when was the last time you used it outside a discussion about DDD? It isn’t part of developers' vocabulary; it comes from books. German doesn’t improve matters: It does have the equivalent “ubiquitär”, but that sounds just as much like a textbook.

That’s the irony. DDD’s very first term is exactly the kind of vocabulary DDD doesn’t want to impose on anyone, yet it imposes it on its own users.

Videos by heise

Ask a team what it would call the language everyone shares, and you’ll hear answers such as “shared language” or “common language”. “Ubiquitous” may say more: that the language isn’t merely shared within its context, but used everywhere — in every conversation, every document and every line of code. Even so, a term that’s more precise but less intuitive loses out. Your users' word wins, even if yours would be better.

The second term is Bounded Context. “Bounded” implies that there are unbounded contexts, too. But there aren’t. Every context has boundaries; that’s what makes it a context in the first place.

Simply saying context would have been enough. It would also have made sense, since everyone says language depends on context: A word’s meaning depends on the context in which it’s used.

I tried this out with developers. The setup: two areas, each with its own language, that need to remain clearly separate. What would they call that? Many came up with “folders”. If a file named customer is in the sales/ folder and another file named customer is in the support/ folder, there’s no conflict. The same name, two meanings, clearly separated:

sales/      support/
  customer    customer
  order       ticket
  invoice     contract

In code, a folder that keeps names separate is something every developer has known for decades — and it serves exactly this purpose: a namespace.

So the words developers already know are obvious: context or namespace. I know the objection: A Bounded Context is more than a namespace because it has its own model and belongs to a team. That’s true. But look at a namespace in any large library. It has its own names and types, and in most cases a single team is responsible for it.

So the objection describes a namespace just as well. When a Bounded Context really does include more — an explicit translation at every point where it meets another context, for example, or sometimes its own data store — those are decisions you make about it. Its name doesn’t have to explain them. “Namespace” may say less than “Bounded Context”, but it’s the word developers already understand. And to express the idea that meaning depends on context, plain “context” would have been enough from the start.

The third term is my favorite: “Aggregate”, meaning a whole made up of several individual parts. Technically, the word isn’t even a bad choice, because an aggregate really does bundle everything on which a group of domain rules depends. But intuitively, it tells you neither what’s being aggregated nor why. That makes it one of the most frequently misunderstood concepts in all of DDD.

The Germanized version isn’t any better: Most people associate the word “Aggregat” with a generator or with the states of matter they learned about in physics class.

The usual explanation doesn’t help much: An aggregate is a transaction boundary. That’s entirely correct and completely useless to anyone who doesn’t already know what an aggregate is. In other words, it’s no explanation at all.

Because neither the name nor the explanation helps, many people fall back on what they know: An aggregate must be an object, as in object-oriented programming — a class with a few child objects. That’s fundamentally wrong, and it becomes obvious as soon as you learn that DDD can just as easily be implemented functionally. An aggregate can be written as two simple functions. One decides what to do with commands; the other updates the state based on events. There’s no class involved. So the question is: How can that work without objects and classes?

Keep that question in mind. The classic definition seems almost designed to invite misunderstanding: a cluster of objects treated as a unit for consistency. The second half of that sentence matters; the first half misleads, pointing toward the bloated object designs just about everyone has seen. I wrote about this in Lean, not bloated: What aggregates and read models really are.

A better explanation is actually simple, as long as you start with commands, events and state, and the rules they must follow. It is rarely presented this way, so I’ll do that here.

A “command” is a request: “I want to borrow this book.” It can be rejected. An “event” is a fact: “The book was borrowed.” It happened, and there’s no changing that.

The “state” follows from all the facts so far: The book is checked out. Commands lead to events, events change the state, and the state determines whether the next command is accepted. For a book, the domain rule is simple: A book that’s checked out can’t be checked out again.

Now for the problem. Alice and Bob both want to borrow Book 42 at the same time. Both commands see the same state — that the book is available — and both are accepted. Two events, one book, two people who have borrowed it: The domain rule has been broken. So anything that affects the same state must not get in each other’s way.

You therefore have to decide what can happen in parallel and what can’t. Everything involving Book 42 has to happen in sequence: borrow it, return it, borrow it again. The same goes for Book 17 and Book 8. But Books 42 and 17 have nothing to do with each other, so their actions can happen in parallel. Think of each book as having its own lane. Actions within a lane happen in sequence; across lanes, everything runs in parallel.

That’s the whole definition. Whatever has to happen in sequence forms an aggregate. Book 42 is an aggregate, not because it’s an object, but because everything that touches it has to wait its turn. An aggregate is a rule about execution order, not an object or a data structure.

If an aggregate is a rule about execution order, the question of its size almost answers itself: as small as the domain rules allow. Which rules have to hold at every moment, and which can be checked a moment later and compensated for if necessary, is a domain decision, as I explained in Consistency is a domain decision. Once that decision is made, the size follows.

Suppose a library member can borrow no more than five books at a time. If that limit must hold without exception at every moment, borrowing a book has to wait not only for everything involving that book, but also for everything involving the member. The member’s lane then merges with the lanes of their books, and the aggregate grows far beyond a single book. If, on the other hand, the limit can be checked a moment later and a sixth loan compensated for, each lane stays as small as a single book.

In developers' language, a lane is very close to a “lock” or a “mutex” — conceptually, but not as a mechanism. An event store such as EventSourcingDB, an event database from the author’s company, can enforce the order without anyone holding a lock while making the decision: It simply rejects a write if the state on which it was based has changed in the meantime. But every developer understands the question behind this: What must not happen at the same time? You don’t need a textbook for that. By that measure, the word “aggregate” does more harm than good.

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.