About this book
Domain-Driven Design was published by Addison-Wesley in 2003. Its author, Eric Evans, gave it the subtitle Tackling Complexity in the Heart of Software. Readers soon called it the blue book, after the colour of its cover, and the name stuck. It is a long book, close to five hundred pages, and it is not quick to read. It has nevertheless become one of the few design books of its decade that working programmers still argue about by name.
The book begins from a plain observation. Many software projects do not fail because the programmers cannot write code. They fail because nobody on the team understands the business well enough, or because what the team does understand never makes it into the code in a usable form. The difficult part of an insurance system is insurance. The difficult part of a shipping system is shipping. Databases, frameworks and networks are hard too, but they are hard in ways that are well documented and shared across many projects. The rules of a particular business are not.
Evans calls this business area the domain. The domain is the subject matter the software serves: the world of cargo bookings, loan syndication, hospital beds, crop insurance or electrical circuit layout. His claim is that for a large class of systems the complexity that matters most lives in the domain, and that the main job of design is to master it. The tool he proposes is a model, a deliberately simplified and organised way of thinking about the domain, which the team builds together with people who know the business, and which is expressed directly in the code.
The book was written for programmers, technical leads and architects who work on such systems, and who use object-oriented languages. Its examples are in Java, with diagrams in a loose form of UML. But the intended reader is broader than that. Evans wants project leaders and senior developers to recognise a style of working, not just a set of classes. Much of the book is about conversation: how developers and experts talk, how they discover what they mean, and how that discovery shapes the program.
The question the book sets out to answer can be put simply. When the business itself is complicated, how should a team design software so that the complexity becomes manageable rather than overwhelming, and so that the design gets better rather than worse as the team learns? The answer is not a single technique. It is a connected set of practices, presented as patterns, that run from naming a class all the way up to dividing a large organisation's systems into parts.
The context matters. In 2003 the industry was moving away from heavy up-front design documents and towards the agile methods described in books such as Extreme Programming Explained. Agile teams worked in short iterations, refactored constantly and distrusted large diagrams. Evans was sympathetic to this movement, but he saw a gap in it. Agile methods said a lot about process and testing and little about how to think deeply about the problem domain. Meanwhile the older modelling tradition said a lot about domain analysis but tended to separate analysts, who drew models, from programmers, who wrote code. Evans tried to join the two. He kept agile's iterative rhythm and refactoring, and he restored serious modelling, but he insisted that the modelling be done by the same people who write the code.
The author
Eric Evans is an American software designer and consultant. Before the book he spent years building business systems for clients, often in object-oriented languages, and often in domains such as finance and logistics where the rules are intricate. The book is visibly the product of that experience. Its examples feel like stories from real projects, sanitised and simplified, rather than textbook exercises. Several of them describe a team that misunderstood the business, struggled, and then found a better model through a long conversation with an expert.
Evans came out of the object-oriented community of the 1990s, which was heavily influenced by Smalltalk and by the patterns movement. That movement took its inspiration from the architect Christopher Alexander, whose books described recurring design problems in buildings and towns as a connected language of patterns, each with a name, a context, a problem and a resolution. Design Patterns, by Gamma, Helm, Johnson and Vlissides, brought this idea into programming in 1994. Evans uses the same form. Each important idea in his book has a name in small capitals, a statement of the problem it addresses, a discussion, and a short summary of the resolution. This makes the book partly a reference work: one can look up a pattern by name and read it as a unit.
After the book appeared, Evans founded a small consultancy called Domain Language, which offered training and consulting in the approach. He became a regular speaker at conferences and took part in a growing community of practitioners. In 2015 he published a short companion, the Domain-Driven Design Reference, which summarises the patterns and adds a few that had become important since 2003, notably domain events. He has said in talks that he would organise the original book differently if he wrote it again, placing strategic design earlier, since many readers never reached it.
Evans is not a theorist in the academic sense. He does not prove things or run experiments. His authority comes from craft and from a careful way of describing what experienced designers do. That shapes how the book should be read. It is advice from a practitioner who has thought hard about his practice, not a formal method. When it is persuasive, it is persuasive because the reader recognises the situations it describes.
The shape of the argument
The book moves from the small to the large, and from the conversation to the code and back again. It is organised in four parts, each a cluster of patterns. Understanding why these parts sit where they do is more useful than knowing what each pattern says.
The first part establishes the basic loop. A team talks with domain experts, sketches a model, writes code that embodies the model, discovers through the code that the model is wrong or thin, and goes back to the experts. Evans names the shared vocabulary that grows out of this loop, and he argues that the model and the implementation must be the same thing seen from two sides. This part is short on technique and long on attitude. It sets the standard against which everything else is measured.
The second part is a toolkit. It describes the kinds of objects that tend to appear in a well-made domain model and the kinds of objects that support them. Here the reader finds the vocabulary that most people associate with domain-driven design: the distinction between objects with identity and objects defined only by their values, the clusters that guard consistency, the objects that create and store other objects. These are often called the tactical patterns. They are useful, but Evans presents them as a means to an end. They make it possible to express a model in code without losing it in technical detail.
The third part is about change over time, and it is the part Evans himself seems to care about most. A first model is almost always shallow. It reflects the surface of the domain, the nouns that appear in a requirements document. As the team works, it finds concepts that were hidden, such as a rule that everyone applied without naming it, or a process that turns out to be a thing in its own right. Evans calls the moment of seeing such a concept a breakthrough, and he describes how to make a design flexible enough that breakthroughs can be absorbed. This part also contains his discussion of what he calls supple design, code that is pleasant to change because its intent is clear and its parts combine predictably.
The fourth part steps back to the scale of a whole system or a whole organisation. Here the question is no longer how to model a single concept but how to live with many models at once, how to decide which part of the domain deserves the best people, and how to give a large system an overall shape. These are the strategic patterns. They include the idea of a bounded context, which is now the most widely cited idea in the book.
One way to see the structure is as a set of nested loops. The innermost loop is a programmer naming a method in the language of the business. Around it is the loop of a team refining its model through conversation and refactoring. Around that is the loop of several teams, each with its own model, negotiating how their models meet. Around that is the organisation deciding where its competitive advantage lies and investing its design effort there. The same discipline, taking the domain seriously and keeping the model honest, applies at every level.
A reader should also know that the book argues by example. Rather than defining a pattern abstractly and then illustrating it, Evans often tells a story first. A team building a cargo tracking system finds that its notion of a route is confused. A team modelling syndicated loans realises that the way shares of a loan are divided is a concept of its own. These stories carry much of the argument. They show what it feels like when a model improves, which no definition can.
One language, spoken everywhere
The idea at the base of the book is what Evans calls the ubiquitous language. It means that developers and domain experts agree on a single set of terms for the concepts of the domain, and that these same terms are used in conversation, in diagrams, in written documents and in the code itself. If the experts speak of a voyage, the code has a Voyage. If they distinguish between a booking and a reservation, so does the code. If a word is ambiguous, the team resolves the ambiguity explicitly instead of letting two meanings drift through the system.
This sounds obvious until one looks at how most projects actually work. Domain experts speak their own jargon. Developers translate it into technical terms in their heads. Requirements documents use a third vocabulary, often written by an analyst in between. The code ends up with names like OrderManager, ProcessData or StatusFlag, which mean nothing to the experts. Every conversation then involves translation, and translation loses information. Mistakes hide in the gaps between vocabularies.
Consider a small example. A library system has a concept that librarians call a hold: a reader asks to borrow a book that is currently out, and is placed in a queue. A developer might implement this as a boolean flag on a loan record and a list sorted by date. When a librarian later says that holds expire after a week if not collected, the developer has to translate expire into some condition on the flag and the list, and may get it wrong. If instead the code has a Hold with a placed date, a ready date and an expiry rule, the librarian's sentence maps directly onto the code. The conversation and the program are about the same things.
Evans makes a stronger point. The language is not just a glossary agreed at the start. It is a tool for finding out what the model should be. When a developer tries to describe a scenario aloud using the model's terms and the sentence sounds awkward, that awkwardness is information. It means the model is missing a concept or has one in the wrong place. Evans encourages teams to talk through scenarios out loud, in the model's language, precisely to hear where it breaks. A change in the language is a change in the model, and a change in the model should change the code.
The ubiquitous language is often confused with a data dictionary or a list of entity names. It is more than that. It includes verbs and rules, not just nouns. It includes the relationships between concepts and the constraints that hold among them. And it is bounded: it is ubiquitous within one model, not across an entire company. That last point leads directly to the strategic part of the book, where Evans admits that a single language for everything is impossible in a large organisation.
Where it leads in practice is simple and demanding. Code review should ask whether names match what the experts say. Meetings with experts should include developers, not only analysts. Documents should use the terms the code uses. When the team discovers a better term, it should rename things in the code even if that is tedious, because the alternative is a slow divergence that makes every later conversation harder.
The model is the code
The second foundational idea is that the model and the implementation must be tightly bound. Evans calls this model-driven design. A model that lives only in diagrams is, in his view, nearly worthless once implementation begins, because the code will drift away from it and nobody will maintain both. Conversely, code designed without regard to a model will be organised around technical convenience, and the domain logic will be scattered and hard to find.
The older practice Evans is arguing against had analysts produce a detailed analysis model, which designers then translated into a design model, which programmers then implemented. Each step lost something. The analysis model was often elegant but could not be implemented efficiently. The design model was implementable but no longer reflected the domain clearly. Insights discovered during programming never travelled back to the analysts. Evans proposes instead a single model that serves both purposes: it must be faithful to the domain and it must be directly implementable. If a model cannot be implemented, it must be changed until it can, and if the implementation reveals a better way of seeing the domain, the model must change too.
This has a consequence for who does the work. Evans argues that the people who write the code must also be involved in modelling, and the people who model must touch the code. He calls them hands-on modellers. If modelling is a separate job, the separation recreates the old gap. A developer who never talks to experts will make local decisions that quietly undermine the model. A modeller who never writes code will propose structures that cannot survive contact with the program.
To make the binding possible, the domain logic must be isolated. Evans recommends a layered architecture, in which the user interface, the application coordination, the domain model and the technical infrastructure live in separate layers. The domain layer contains the business concepts and rules and nothing else. It does not know about screens, HTTP requests or SQL. This is not a new idea, and Evans does not claim it is. His point is that without such isolation the model cannot be seen in the code, because it is buried among technical concerns. A rule about when a loan can be drawn down should be readable in one place, not split between a form validator, a stored procedure and a batch job.
An analogy may help. An architect's drawing of a house is useful only if the house is built according to it, and only if, when the builders find a problem, the drawing is updated. A drawing that shows a staircase that was never built misleads everyone who reads it later. In software the code is the house, and the model is the drawing, except that in good domain-driven design the drawing is mostly the code itself, read at the right level. Diagrams and documents are supplements that explain the model, not a separate authority.
This idea is often confused with model-driven architecture, a quite different movement of the same period that tried to generate code automatically from formal UML models. Evans's approach goes almost the other way. He distrusts heavy formal models and prefers sketches, conversations and code. What matters is not the notation but the correspondence between the concepts in people's heads and the structures in the program.
Knowledge crunching
Evans uses the phrase knowledge crunching for the work that produces a model. The image is of a large, unsorted mass of information being chewed down into something compact and useful. Domain experts know a great deal, but much of what they know is tacit. They apply rules without stating them, recognise exceptions without being able to define them, and use words whose precise meaning they have never had to spell out. Developers arrive knowing almost nothing of the domain but with a habit of demanding precision, since a computer accepts nothing vague. Knowledge crunching is the meeting of these two kinds of knowledge.
In practice it looks like a series of conversations, sketches and small experiments. A developer asks an expert to walk through a real case. The developer sketches the objects involved and the relationships between them. The expert corrects the sketch. The developer writes a little code, perhaps a prototype, and finds a case the sketch did not cover. Back they go. Over many rounds the model gains concepts, loses some, and settles into a shape that both sides can reason with. Evans stresses that this is not requirements gathering, in which developers take dictation. Both sides learn. Experts often say that the process clarified their own understanding of their work.
The difference from ordinary analysis lies in the selectivity. A model is not a complete description of the domain. It is an abstraction chosen to solve particular problems. A map of a city for drivers omits footpaths. A map for walkers omits motorway junctions. Both are true, and both are useful precisely because they leave things out. Knowledge crunching involves deciding, repeatedly, what to leave out. Evans warns that teams which try to model everything produce models too large to use. The test of a model is whether it makes the system's actual problems easier to solve.
One more feature matters. Knowledge crunching never finishes. As the business changes, as the system meets new cases, and as developers grow more fluent in the domain, the model keeps moving. A team that treats modelling as a phase at the start of the project has misunderstood the approach. Learning continues for as long as the software lives, and the code should keep absorbing it.
Things with identity and things with values
Among the tactical patterns, the most useful single distinction is between entities and value objects. An entity is an object whose identity matters and persists over time. A customer is an entity: the customer may change name, address and phone number, and is still the same customer. A value object has no identity of its own. It is defined entirely by its attributes. An amount of money, a date range, a postal address used for a single shipment, a colour: two value objects with the same attributes are interchangeable.
The distinction sounds academic but it has large practical effects. Entities need a way to be identified, usually an identifier that is unique and stable, and they need care in how they are compared, stored and tracked through their life cycle. Value objects need none of this. They can be created freely, copied, shared and thrown away. Evans recommends that value objects be immutable: once created, they do not change. If you need a different amount of money, you create a new one. Immutability removes a whole class of bugs, in which two parts of a program share an object and one changes it unexpectedly under the other.
A common mistake in business systems is to treat everything as an entity, because everything is stored in a database table with an identifier column. The result is a model in which an address or a price has an identity it does not need, and in which code must worry about whether two addresses with the same content are the same address. Another common mistake is to represent values as bare primitives, so that money is a decimal number and a date range is two separate dates. Then the rules about money, such as currency and rounding, or about ranges, such as overlap and containment, are scattered throughout the code. Wrapping them in small value objects collects the rules in one place and gives them names.
Whether something is an entity or a value depends on the domain, not on the thing itself. Evans's own example is an address. For a mail-order company, an address may be just a value attached to an order. For a postal service planning delivery routes, an address may be an entity with its own history. The same physical fact can play different roles in different models. This is a small preview of the larger theme that models are tools for particular purposes, not mirrors of reality.
Evans also discusses services: operations that belong to the domain but do not naturally belong to any single entity or value. Transferring money between two accounts is the classic example. Forcing the operation onto one account or the other distorts the model. A domain service is a named operation in the ubiquitous language that coordinates several objects. Evans warns against overusing services, which can lead to a design where all logic lives in procedures and the objects are empty records. That anti-pattern was later named the anaemic domain model by Martin Fowler, and Evans's book is part of the background to the name.
Boundaries of consistency
Business objects are connected in many ways. An order has lines. Each line refers to a product. The order belongs to a customer, who has other orders. In a naive design every object can reach every other, and any piece of code can change any of them. This makes it very hard to say what must be true at any moment, and very hard to change the system safely when many users act at once.
Evans's answer is the aggregate. An aggregate is a cluster of objects treated as a single unit for the purpose of changes. It has one root entity, through which all outside access must pass. Objects outside the aggregate may hold a reference to the root but not to the inner parts. The root is responsible for enforcing the rules, called invariants, that must hold across the whole cluster. An order and its lines might form an aggregate, with the order as root. A rule such as the total of the lines must not exceed the customer's credit limit for this order can then be enforced in one place, because no line can be added or changed except through the order.
An analogy is a car. A mechanic outside the workshop does not reach in and adjust a single piston while the engine runs. The engine is serviced as a unit, through defined points of access, and its internal consistency is the engine's own concern. Other systems in the car may refer to the engine as a whole, but not to its pistons.
Aggregates matter for three reasons. They make invariants enforceable, because there is a clear owner for each rule. They define transaction boundaries, because a change to one aggregate can be committed as a unit while changes across aggregates may be allowed to become consistent more slowly. And they simplify reasoning, because a developer can think about one aggregate at a time. Later practitioners, especially Vaughn Vernon, pushed this further, recommending small aggregates and references between aggregates by identifier only. These refinements are in the spirit of the original but sharper than what Evans wrote in 2003.
Aggregates are often confused with object graphs that happen to be loaded together, or with database tables joined by foreign keys. The question is not what is stored together but what must be consistent together. Drawing aggregate boundaries is genuinely difficult, and it is one of the places where a team's understanding of the domain shows. If two things must always change together, they probably belong in one aggregate. If they can tolerate a delay, they probably do not.
Factories and repositories
Two further patterns support aggregates. A factory encapsulates the creation of complex objects or whole aggregates, so that the creation logic, which may involve many rules, does not clutter the objects themselves or the client code. A repository gives the illusion of an in-memory collection of aggregates of one kind, with methods to add, find and remove them, while hiding how they are actually stored. The point of a repository is that domain code can ask for the cargo with a given tracking number without knowing about tables, queries or caches.
Repositories in particular have been widely adopted, and widely misused. A repository with a method for every conceivable query becomes a dumping ground. Evans's intent was narrower: one repository per aggregate root, offering access in terms the domain understands. Later he and others noted that queries for reporting and display often need a different structure altogether, which led to the separation of command and query models discussed below.
Deepening the model
The third part of the book contains what many experienced readers consider its heart. Evans argues that the first model a team builds is almost always naive. It follows the obvious nouns in the requirements. It works, more or less, but it is awkward. Simple requests from the business require complicated changes. Certain rules keep being re-implemented in different places. Experts say things that do not quite fit.
Over time, if the team keeps listening and keeps refactoring, the model can deepen. A deep model is one that captures the essential concepts of the domain in a way that makes the experts' concerns simple to express. Evans describes how such models are reached. Often it is not by gradual improvement but by a sudden shift, when someone realises that a concept the team had been treating as a side detail is actually central. Before the shift, the code is full of special cases. After it, the special cases fall away, because they turn out to be instances of a single idea.
His most famous example concerns a loan syndication system, where several banks lend money together. The team at first modelled each bank's share of a loan as a fixed percentage. But real deals did not behave that way. Shares of a facility and shares of particular drawdowns could differ, and the way payments were divided depended on the situation. After much struggle the team recognised that a share pie, a way of dividing an amount among participants, was a concept in its own right that could be applied to many different amounts. Once that concept existed in the model, a large amount of tangled logic became simple. We describe the story only in outline; the details are worth reading in the book.
Evans names several techniques for finding hidden concepts. Listen for terms the experts use that are absent from the code. Look for awkward places where the design needs special handling. Notice contradictions between what different experts say, which often reveal two concepts being confused. Read the domain's own literature, since many fields have already worked out good concepts. Make implicit constraints explicit by giving them objects. Turn important processes into objects when the experts talk about them as things.
Specifications
One of the patterns from this part has proved especially useful. A specification is an object that represents a rule or criterion, such as an invoice is overdue, or a container is suitable for hazardous cargo. Instead of burying the rule inside a method, the team gives it a name and an object. The same specification can then be used for several purposes: to test whether a given object satisfies the rule, to select matching objects from a collection, or to describe what kind of object should be created. Specifications can be combined with and, or and not, which lets complex rules be built from simple, named parts. The pattern is a small, concrete example of what Evans means by making implicit concepts explicit.
Supple design
A deep model is not enough if the code that implements it is hard to work with. Evans uses the phrase supple design for code that invites change: its intent is clear, its behaviour is predictable, and its parts combine without surprises. He gives a group of patterns for achieving this, and they overlap with advice found in other books on this shelf.
Intention-revealing interfaces mean that classes and methods are named for what they do and why, in the ubiquitous language, so that a developer can use them without reading their implementation. Side-effect-free functions mean that as much logic as possible is placed in operations that compute results without changing state, which makes them safe to call and easy to combine. Assertions mean that the effects of operations which do change state are stated clearly, as preconditions, postconditions and invariants, either in code or in tests. Conceptual contours mean that the boundaries of classes and methods follow the natural divisions of the domain, so that changes tend to fall within a single unit rather than cutting across many.
Evans also argues for standalone classes, which depend on as few other classes as possible, and for closure of operations, where an operation takes and returns values of the same type, as adding two amounts of money yields an amount of money. Such operations can be chained and combined freely, which is one of the reasons arithmetic is so powerful. Where possible, he favours a declarative style, in which rules are stated as combinations of named parts rather than coded as procedures.
The best way to understand supple design is through contrast. Imagine a pricing module where each new discount rule requires editing a long method with nested conditions, and where calling the method also updates a counter and writes a log entry. Every change is risky. Now imagine one where discounts are value objects that can be combined, where calculating a price has no side effects, and where the rules are expressed as named specifications. Adding a new discount means adding a new small object. That is supple design. It does not make the domain simpler, but it stops the code from adding complexity of its own.
This part of the book connects closely to Refactoring by Martin Fowler, which provides the step-by-step mechanics for improving code safely, and to Extreme Programming Explained, which made constant refactoring a team practice. Evans's addition is the direction of refactoring. Fowler's refactorings improve code structure. Evans asks that they also move the code towards a deeper model of the domain. He calls this refactoring toward deeper insight.
Bounded contexts and the map between them
The idea from this book that has travelled furthest is the bounded context. It begins from an honest admission. In any large system, and certainly in any large organisation, there will be more than one model. The sales department's notion of a customer is not the same as the billing department's, which is not the same as the support department's. Trying to force them into one unified model produces a bloated compromise that serves nobody well and that no single team can understand.
Evans's response is to accept multiple models but to make their boundaries explicit. A bounded context is the setting within which a particular model applies and a particular language is consistent. Inside the context, the terms have precise meanings and the code is kept consistent with them. Outside the context, other models may use the same words differently, and that is acceptable, because the boundary is known. A word like account can mean one thing in the banking context and another in the user-login context, without confusion, as long as everyone knows which context they are in.
Bounded contexts usually align with teams, codebases and databases. One team owns one context, more or less. Within the context, Evans recommends continuous integration of the model: frequent merging of code, automated tests, and constant conversation, so that the model does not fragment inside its own boundary. Fragmentation inside a context is a real danger. When two developers interpret a concept slightly differently and both versions survive in the code, the context has quietly split without anyone deciding it should.
Between contexts, the relationships must be managed. Evans introduces the context map, a description of all the bounded contexts in a system and how they relate. It is not an architecture diagram in the usual sense. It records who depends on whom, how models are translated at the boundaries, and what the political and organisational relationships between teams are. Evans is frank that these relationships are often shaped as much by organisation as by technology.
Kinds of relationship
He names a set of patterns for these relationships. A shared kernel is a small part of the model that two teams agree to share and change only together. A customer and supplier relationship exists when one team depends on another's output and the upstream team takes the downstream team's needs into account. A conformist relationship exists when the downstream team simply adopts the upstream model because it has no influence over it. An anticorruption layer is a translating layer that a downstream team builds to protect its own model from a poorly fitting upstream model, often a legacy system. Separate ways is the decision not to integrate at all, when the cost exceeds the benefit. An open host service is a protocol that one context offers to many others, and a published language is a well-documented shared format for exchanging information.
The anticorruption layer deserves a closer look, because it is one of the most practically useful ideas in the book. Suppose a new system must draw data from an old mainframe whose model is confused and whose terms do not match the new design. If the new code uses the old model directly, the confusion spreads. Instead, the new team builds a layer whose only job is to translate: it speaks the old system's language on one side and the new model's language on the other. The new model stays clean. The cost is the effort of building and maintaining the translation, but the benefit is that the new context can evolve without being dragged backwards. Michael Feathers's Working Effectively with Legacy Code, on the same shelf, addresses the inside of such old systems; Evans addresses the boundary.
Bounded contexts are often confused with modules, packages or microservices. A module is a way of organising code within a model. A microservice is a deployment unit. A bounded context is a boundary of meaning. In practice a bounded context may contain several services or a single service may sit inside one context, but the principle is that a service should not span two contexts with conflicting meanings. When microservice architecture became popular in the 2010s, its advocates found in Evans's bounded contexts the clearest available guide to where service boundaries should be drawn, and this revived interest in the book among a new generation.
The deeper lesson is about language and scale. A ubiquitous language is only possible within limits. Beyond a certain size, a single shared vocabulary breaks down, as it does in human societies. The solution is not to give up on precise language but to accept a federation of precise languages, with clear borders and explicit translation at the crossings.
The core domain and distillation
The second strategic idea is about priorities. Not every part of a system is equally important. An online marketplace needs user accounts, payments, notifications, search, recommendation, fraud detection and seller management. Some of these are commodities that work much the same everywhere. Others are where the business actually differs from its competitors. Evans calls the latter the core domain, and he argues that the best design effort and the best people should be concentrated there.
This is a counter-intuitive point for many technical teams. Skilled developers are often drawn to technical infrastructure, frameworks and generic problems, because those are interesting and transferable. Business-specific modelling can look mundane. Evans argues that this instinct is backwards for the organisation. Generic problems should be solved as cheaply as possible, by buying, adopting open-source components, or building simply. The core domain is where depth of modelling pays off, because it is what makes the system worth having.
He calls the process of identifying and sharpening the core distillation, borrowing the image of separating a valuable essence from a mixture. Techniques include writing a short domain vision statement that says what the core is and why it matters; highlighting the core within the codebase so that developers can find it; separating generic subdomains into their own modules or contexts; extracting cohesive mechanisms, such as a complex calculation engine, so that the core is not cluttered by them; and, where it helps, separating the core physically into its own module or context.
An example helps. A small agricultural cooperative that builds software to schedule crop collection from many farms has generic needs, such as user login, invoicing and SMS messages, and a core need, which is deciding efficiently which vehicle collects what from where under constraints of perishability and road access. The invoicing can use a standard package. The login can use a common library. The routing and collection logic is where the cooperative's knowledge lives, and where careful modelling with experienced drivers and farmers will repay effort. Distillation means arranging the design so that this core is visible, protected and given attention.
The idea is sometimes misread as saying that generic parts do not matter. They matter, but they should not absorb the team's best modelling energy, and they should not be allowed to entangle the core. Another misreading is that the core is fixed. In fact it shifts as the business changes, and part of strategic design is noticing when it has moved.
Large-scale structure
The last cluster of patterns in the book concerns the overall shape of very large systems. Even with clear bounded contexts and a well-distilled core, a big system can be hard to grasp as a whole. Evans proposes that teams sometimes adopt a large-scale structure, a set of high-level rules or concepts that give every part a place in a bigger picture.
He describes several such structures. A system metaphor, borrowed from Extreme Programming, gives the whole system a guiding image. Responsibility layers arrange the domain into broad layers by kind of responsibility, such as operations, capabilities, policies and commitments, with dependencies running in one direction. A knowledge level separates objects that describe how other objects should behave, such as rules and types, from the operational objects themselves. A pluggable component framework defines a central abstract core into which interchangeable components fit.
Evans insists that any such structure must be allowed to evolve. He names this evolving order. A structure imposed at the start of a project and never revised becomes a straitjacket. The structure should be discovered as the system grows and changed when it no longer fits. He also warns against too much structure. Many systems need none of these patterns, and adopting one prematurely adds complexity without benefit.
This part of the book is the least cited today, and probably the least read. Its patterns are abstract and its examples are necessarily simplified, since a truly large system cannot be described in a few pages. But it completes the logic of the book. From the naming of a single method up to the overall shape of a large system, Evans applies the same discipline: let the structure come from the domain, make it explicit, and change it when understanding grows.
The tradition around it
Domain-Driven Design answers two traditions at once. On one side is the object-oriented analysis and design tradition of the 1980s and 1990s, which produced many methods for modelling business domains with objects and diagrams. That tradition took the domain seriously but tended to separate modelling from programming. On the other side is the agile movement, represented on this shelf by Extreme Programming Explained and by Refactoring, which joined design and coding tightly but said less about deep domain analysis. Evans took the seriousness of the first and the working rhythm of the second.
Its pattern form comes from Design Patterns, on this shelf, and from Christopher Alexander's architectural writing before it. But its patterns are of a different kind. The Gang of Four patterns are mostly technical: they describe ways of arranging classes to achieve flexibility. Evans's patterns are mostly about meaning: they describe ways of arranging a model so that it reflects the domain. The two sets complement each other. A strategy or composite pattern from the earlier book can be the right way to implement a specification or a policy in Evans's sense.
Several other books on the shelf bear on it. The Psychology of Computer Programming and Peopleware argue that software is shaped by people and teams, a theme Evans picks up in his treatment of context maps, where team relationships determine technical boundaries. This links to an older observation, usually called Conway's law, that systems tend to mirror the communication structures of the organisations that build them. Code Complete and Clean Code cover the construction of code at a finer grain; Evans assumes that craft and builds on it. A Philosophy of Software Design, by John Ousterhout, approaches complexity from a different angle, emphasising deep modules and the management of interfaces. Ousterhout and Evans agree that complexity is the central problem but locate it differently: Ousterhout mostly in the structure of code, Evans mostly in the domain.
After Evans, the community around domain-driven design grew steadily. Vaughn Vernon's Implementing Domain-Driven Design, published in 2013, gave more concrete guidance and refined the rules for aggregates. Greg Young and others developed the separation of command and query responsibilities, in which the model used for changes is separated from the model used for reading, and event sourcing, in which the state of an entity is stored as a sequence of events. Alberto Brandolini devised event storming, a workshop technique in which developers and experts map a domain using sticky notes for domain events, which became a popular way of discovering bounded contexts. Evans himself later made domain events, meaningful things that happened in the domain, a first-class part of the vocabulary.
Designing Data-Intensive Applications, by Martin Kleppmann, also on this shelf, gives the technical foundations for several of these later developments, including event logs, eventual consistency and the trade-offs of distributed data. Read alongside Evans, it explains why aggregate boundaries and bounded contexts matter so much once data is spread across many machines. The microservices movement of the 2010s, finally, adopted the bounded context as its main tool for deciding where services should begin and end.
Questions and criticisms
The most common complaint is about the book's organisation. The strategic patterns, which many readers now regard as the most valuable part, come last, after hundreds of pages on entities, repositories and supple design. Many readers stop before reaching them and come away thinking that domain-driven design is a set of class stereotypes. Evans has acknowledged this himself. The fault is not in the ideas but in their order, and a reader who knows it can compensate.
A second criticism is that the tactical patterns have been over-applied. Teams adopt entities, value objects, repositories, factories and services as a mandatory template for every project, including simple ones. The result is ceremony: a five-table application wrapped in layers of abstraction it does not need. Evans was clear that the approach is meant for complex domains, and that simple data-entry applications may be better served by simpler designs. That message is easy to miss. A fair reading is that the patterns are tools, to be used where the domain rewards them.
A third concern is that the book is very abstract in places. Its examples are real but simplified, and its discussion is often at the level of principles. Developers looking for a step-by-step recipe find it frustrating. Later books, especially Vernon's, filled this gap with concrete code. Some readers find the prose dense and the diagrams dated. The UML conventions and Java idioms of 2003 now look old, and some of the infrastructure assumptions, such as object-relational mapping in a single database, have been overtaken.
A fourth objection is more fundamental. Some critics argue that the emphasis on rich object models is tied to object-oriented programming and fits less well with functional programming, data-oriented design, or systems where most logic is in data pipelines. Others have shown that the core ideas translate. Scott Wlaschin's work on domain modelling in functional languages, for example, uses types to express the ubiquitous language and invariants, often more precisely than objects do. The deeper ideas, such as ubiquitous language, bounded contexts and core domain, do not depend on objects at all.
A fifth issue is practical. Domain-driven design asks for close, sustained collaboration with domain experts. In many organisations this is hard to obtain. Experts are busy, may be distant, and may not see why they should spend hours talking with programmers. The approach assumes a degree of access and goodwill that is not always available. Teams that cannot get it can still apply parts of the approach, but should not pretend that a model built without experts is the same thing.
What has held up is considerable. The idea that the domain is the main source of essential complexity remains persuasive. The ubiquitous language is now standard advice. The distinction between entities and value objects is part of everyday vocabulary. Aggregates, with later refinements, remain the clearest way to think about consistency boundaries. Above all, bounded contexts and context maps have become the dominant way of thinking about how large systems should be divided. Few design books from 2003 are cited as often, by as many kinds of practitioner.
What later work changed is mostly emphasis and technique. Domain events moved to the centre. Aggregates became smaller. The separation of reading and writing models became common. Collaborative discovery techniques like event storming made the conversation with experts more structured. And the arrival of distributed systems at every scale made the strategic patterns more relevant than Evans could have expected in 2003.
Why it is on this shelf
This shelf gathers books on Vedanta, Jyotish, science, economics and technology. What they share is a concern with how to see clearly: how to distinguish what is essential from what is incidental, and how to build understanding that holds up. Domain-Driven Design belongs among them because it is, beneath its technical surface, a book about understanding a field well enough to describe it precisely.
Its central discipline, finding the right concepts and naming them carefully, is the same discipline that any serious study requires. A student of Jyotish learns a technical vocabulary in which each term has an exact meaning, and learns that confusing two terms produces wrong conclusions. An economist learns that a model is useful only within its assumptions and that two schools may use the same word for different things. Evans's bounded context is a programmer's version of a lesson that every careful reader learns: meaning is local to a framework, and translation between frameworks must be done deliberately.
The book also has a practical place. Anyone building software for a real business, especially one with unusual rules that generic tools do not handle, will meet the problems Evans describes. Orders, routes, credit, returns, agents and seasons all have local logic that must be learned from the people who live with it. The book gives a method for learning it and for keeping what is learned in the code.
Finally, the book is a lesson in humility. Evans assumes that the first model is wrong, that understanding comes slowly, and that the design must be kept open to correction. That attitude is worth keeping beside any body of knowledge, old or new.
How to read it
Do not read this book straight through on a first pass. Its order works against new readers. A better plan follows.
Begin with the first part, on putting the domain model to work. Read it slowly. It is short, and it sets out the attitude that the rest of the book depends on. Pay particular attention to the ubiquitous language and to the argument for binding model and code. Read the cargo example closely, since it returns throughout the book.
Next, jump to the fourth part, on strategic design. Read the chapters on bounded contexts, context maps and distillation of the core domain. Skim the large-scale structure chapter on a first pass; it is the most abstract and the least likely to apply to your current work. With a pencil, draw a context map of a system you know: list its contexts, mark which are upstream and downstream, and name each relationship using Evans's patterns. This exercise is worth more than a second reading.
Then return to the second part, on the building blocks. Read it with your own code open. For each pattern, find an example in your code and ask whether it fits. Is that class really an entity, or a value object treated as one? Where are the aggregate boundaries, and are they enforced? Do not try to adopt everything at once.
Finally read the third part, on refactoring toward deeper insight and supple design. It makes more sense once the vocabulary is familiar and once you have tried to apply it. The loan syndication story is worth reading twice. Work through the specification pattern in code, since it is easy to try and often immediately useful.
At a pace of a chapter or two a week, with exercises, the book takes two to three months. That is not too long. Readers who rush it tend to take away only the class stereotypes.
From this shelf, read Refactoring alongside the third part, since it supplies the mechanics Evans assumes. Read Designing Data-Intensive Applications after the strategic part, to see what bounded contexts and aggregates mean when data is distributed. Read A Philosophy of Software Design for a contrasting view of where complexity lives. Read Working Effectively with Legacy Code if your context map includes old systems behind an anticorruption layer. Read Peopleware and The Psychology of Computer Programming to understand why the team relationships on a context map matter as much as the technical ones.
Questions to carry
- In a system you know, which part is the core domain, and does it actually receive the best design effort?
- Which terms do the domain experts use that appear nowhere in the code?
- Which names in the code would mean nothing to an expert?
- Where in your system is the same word used with two different meanings, and is the boundary between them explicit?
- Which objects in your design are treated as entities but are really values?
- What rules must always hold across a group of objects, and which object is responsible for enforcing each one?
- Where would an anticorruption layer protect your model from an older or external system?
- When did your team last change its model because of a new insight, and how hard was the change?
- Which of your team's relationships with other teams is customer and supplier, and which is merely conformist?
- What concept is your code handling through scattered special cases that might be a single missing idea?
- Is your project complex enough to justify the full approach, or would a simpler design serve?
- How much of your domain logic can be read in one layer without seeing database or interface code?
- How do the boundaries of your system's contexts mirror the boundaries of your organisation?
Words to know
- Domain: The subject area the software serves, such as shipping, lending or crop collection, with its own rules and language.
- Domain expert: A person who knows the domain deeply from practice, and with whom developers build the model.
- Model: A selective, organised abstraction of the domain, built for a particular purpose and expressed in code.
- Ubiquitous language: The shared vocabulary of a model, used consistently by developers and experts in speech, documents and code.
- Model-driven design: The practice of keeping the model and the implementation as one, so that changes to either change both.
- Hands-on modeller: A person who both shapes the model and writes code, closing the gap between analysis and implementation.
- Layered architecture: A separation of user interface, application, domain and infrastructure, so the domain logic stands apart.
- Entity: An object defined by a continuing identity rather than by its attributes.
- Value object: An object defined only by its attributes, best made immutable and freely interchangeable.
- Domain service: A named domain operation that does not belong naturally to a single entity or value.
- Aggregate: A cluster of objects changed as one unit, with a root that enforces the cluster's invariants.
- Invariant: A rule that must always hold true for a set of objects.
- Factory: An object or method that encapsulates the creation of complex objects or aggregates.
- Repository: An object that gives collection-like access to aggregates while hiding storage details.
- Specification: An object that represents a named rule, usable for testing, selection and creation.
- Supple design: Code whose intent is clear and whose parts combine predictably, making change easy.
- Deep model: A model that captures the essential concepts of a domain, so expert concerns are simple to express.
- Bounded context: The explicit boundary within which a model and its language apply consistently.
- Context map: A description of all bounded contexts in a system and the relationships between them.
- Anticorruption layer: A translating layer that protects one model from the concepts of another.
- Shared kernel: A small part of a model that two teams share and change only by agreement.
- Core domain: The part of the domain that gives the business its distinctive value, deserving the best effort.
- Generic subdomain: A part of the domain that is common across businesses and can be bought or built simply.
- Distillation: The work of identifying, separating and sharpening the core domain.
- Domain event: A record of something meaningful that happened in the domain, added to the vocabulary after the book.
A note on this edition
This is a study edition written for this shelf in our own words. It describes and comments on Eric Evans's Domain-Driven Design but does not reproduce its text, examples or diagrams. Where we mention the book's stories, we give them only in outline. The book itself is in copyright, and it repays reading in full. It is worth getting from a library or a bookshop, and worth keeping near the desk for the years in which its lessons slowly become your own.