<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Philip Jander on Medium]]></title>
        <description><![CDATA[Stories by Philip Jander on Medium]]></description>
        <link>https://medium.com/@phj-software?source=rss-2e205c052e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8BUMiU6KWilcSkwr.jpg</url>
            <title>Stories by Philip Jander on Medium</title>
            <link>https://medium.com/@phj-software?source=rss-2e205c052e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 13:15:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@phj-software/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[An Introduction to Domain-Driven Design (DDD)]]></title>
            <link>https://domain-driven-software.com/an-introduction-to-domain-driven-design-ddd-1025bce518c2?source=rss-2e205c052e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/1025bce518c2</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[business-software]]></category>
            <dc:creator><![CDATA[Philip Jander]]></dc:creator>
            <pubDate>Thu, 07 Nov 2024 17:13:59 GMT</pubDate>
            <atom:updated>2024-11-08T00:45:29.540Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>Domain-Driven Design (DDD): Core Concepts and Benefits</h3><p>Domain-Driven Design (DDD) is a software development approach that places an emphasis on deep understanding and alignment between software solutions and the business domain they serve.</p><p>Created by Eric Evans and popularised through his book “<a href="https://www.amazon.com/-/dp/0321125215">Domain-Driven-Design — Tackling Complexity in the Heart of Software</a>”, often called the “DDD Blue Book,” DDD provides a framework for effectively designing complex systems by making domain knowledge the focal point of software development. But what exactly does DDD involve, and why do many consider it so crucial to efficiently building correct and maintainable software?</p><figure><img alt="Cover of Eric Evans’s Domain-Driven Design book" src="https://cdn-images-1.medium.com/max/278/1*YpWfl3JWdJyKrIhvVnXWzw.png" /><figcaption>The “Blue Book” by Eric Evans — Original publication of the DDD idea (photo by the author).</figcaption></figure><h3>The Core Idea of Domain-Driven Design</h3><p>At its heart, DDD encourages developers to focus on building a <strong>shared understanding </strong>of the<strong> problem domain </strong>with<strong> domain experts</strong>. Instead of creating software as a mere collection of tables, buttons, and procedures at the request of analysts, DDD is all about understanding the requirements deeply, developing meaningful abstractions that mirror the business domain, and using those abstractions to shape the software’s design.</p><p>This approach stands in contrast to traditional practices where developers might blindly follow a specification without fully understanding the core concepts or purpose behind it. DDD insists on communication, learning, and adapting. It’s not just about creating software —<strong> it’s about creating the right software based on domain knowledge</strong> and continuously improving it as new insights emerge.</p><h4>Core Concepts of Domain-Driven Design</h4><p>To understand DDD more deeply, let’s look at how its core concepts facilitate connecting domain knowledge to the resultant software system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dERgD6PtyBuLE4zj05unzA.png" /><figcaption>Concept map for DDD core concepts</figcaption></figure><p><strong>Ubiquitous Language</strong>: In DDD, developers, business experts, and stakeholders develop a shared, well defined language, which is called the “ubiquitous language.” This means everyone uses the same vocabulary when talking about the domain, minimising misunderstandings and aligning technical implementation with business needs. The ubiquitous language is constantly refined as the domain evolves, ensuring that everyone is on the same page. In the process of creating the ubiquitous language, domain concepts are discovered and filled with meaning.</p><p><strong>Bounded Contexts</strong>: As large domains can be too complex to represent in a single model, DDD divides them into different “bounded contexts.” A bounded context represents a distinct section of the domain where specific terms and concepts are valid. This helps developers focus on different parts of the system separately, avoiding ambiguity and promoting clear boundaries. An often-used example for the necessity of bounded context is the term <em>invoice</em>, which in business software will be found with two distinct meanings: invoices received by suppliers (e.g. part of an <em>accounts payable</em> context) and invoices forwarded to customers (part of an <em>accounts receivable</em> context). This precision in defining the language is crucial for directly relating software construction to the models.</p><p><strong>Model-driven design</strong>: DDD is based on building models — abstract representations of the domain — that help shape the structure of the software. These models are not just diagrams; they start as a mental model within the persons involved in designing the domain and evolve into the actual code that reflects the core business logic. By aligning software with the domain model, DDD aims to ensure that the system behaves in a way that directly addresses business goals and processes, a practice for which Eric coined the term <em>supple design</em>. A good part of his book is devoted to exemplifying this in the context of an object-oriented (as in C#, Java) language within the canonical vertical slice architecture which was predominant at that time. While the examples, named <em>tactical patterns</em>, might be a bit outdated by now, the underlying concept is quite time-less and lies at the heart of employing DDD in software engineering.</p><p><strong>Continuous Learning and Adaptation</strong>: DDD sees software development as a continuous learning process. Requirements are always changing, and so are insights about the domain. A key DDD practice is to “refactor toward deeper insight,” which means that as developers gain more understanding, the software should evolve to reflect these insights. This practice helps ensure that the software remains aligned with the evolving needs of the business.</p><p><strong>Strategic Design</strong>: Beyond modelling individual domain components, DDD emphasises the importance of understanding the strategic relationships between different bounded contexts. This helps teams to organise their software in ways that manage dependencies and handle different external influences over time. Over the years since the original DDD “Blue Book” publication, this area has received a significant amount of attention and development.</p><h3>Tactical vs. Strategic Design in DDD</h3><p>The <strong><em>strategic design</em></strong> elements of DDD involve understanding the relationships between different parts of the domain and adapting to different influences, ensuring that the software is resilient in the face of change.</p><p>As an example, consider the relation of two software systems A and B that interact via an interface and consider the question, how an change of the domain model / concepts underlying system A affects the interface contract and subsequently system B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mekqpnOzt6LdNOYCEn34_A.png" /><figcaption>Strategic design — considering the power dynamics of relationships.</figcaption></figure><p>In the reality of software engineering, questions like this are very common and often a source of profound trouble. Strategic DDD addresses this by incorporating the power dynamics of the relationship into the design of the interaction.</p><p>Assuming, as an example, that System A is defined by a governmental / regulatory body, it follows, that the interface contract is entirely under the control of System A’s stakeholders. System B can therefore opt to always <em>conform</em> whenever the concepts governing the interface change by adapting its own domain model. Or it can choose to isolate against corruption of its model by such changes by explicitly translating between A’s concepts and its own internal domain model — such isolation is then aptly called an <em>anti corruption layer</em>.</p><p>Strategic Domain-Driven Design encompasses these and several other scenarios. By explicitly considering the dynamics of different contexts’ relationships, the domain model is guarded against deterioration as inevitable changes affect the system design.</p><p>While the strategic design is concerned with the structure of the domain model and the relationships between these contexts, the <em>tactical</em> design is concerned with the individual concepts within the domain model, their characteristics and relations.</p><p>The DDD book provides <strong><em>tactical patterns</em></strong> that are focused on environments with class-based OOP languages like Java, C#, or C++, where concepts like entities, aggregates, and repositories are essential parts of the toolkit. However, the fundamental ideas — like focusing on abstractions, domain models, and meaningful boundaries — are applicable across different paradigms, whether in functional programming, micro-services, or beyond.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RO06Jb4BgNGiAYycmxvFzA.png" /><figcaption>Concept map of the most prominent tactical DDD concepts.</figcaption></figure><p>Prominent concepts underlying the tactical patterns include the <em>entity</em>, a representation of a tangible domain concept, not only including an instance identity, lifecycle and state changes, individual data and their validation, but rather all domain rules that can be expressed by that entity and its collaborations with other entities. As such, an entity commonly corresponds either to a thing in the physical world or an idea in a conceptual world such as a building, a car, a person, a person’s role, a bank account or a contract.</p><p>In contrast, <em>value objects</em> capture domain concepts that are simply defined by a value — albeit also covered by rules, such as monetary values, dates, weights, account numbers, phone numbers, etc — in short: data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KlPwPiTx9QiSaBYM6ahcQg.png" /><figcaption>How to represent $10 in the domain model…</figcaption></figure><p>The canonical example illustrating their difference is the question whether the concept of money — think “$10” — should be represented in a domain model as an entity or a value object. As often, it depends — on the context (pun intended). If the software system is modelling the US Federal Reserve System, the actual bank note has an identity and a life cycle. Hence it will be represented as an entity in the domain model. If the context is a mere cash register, the system very likely only cares for the monetary value, so the concept of money will be represented as a value object.</p><p>The tactical pattern representing rules that must be evaluated simultaneously or data that must change in lockstep is called an <em>aggregate </em>in DDD. An aggregate is basically a group of entities and value objects that “belong” together. Representations of aggregates in software systems commonly map to transaction boundaries of the underlying data storage. Entities within an aggregate are sometimes said to be identifiable only in relation to their aggregate. Think “front left wheel” (an entity), which only has a meaning if you know which “car” (an aggregate) one is referring to. Unless the software is about a wheel storage enterprise, then “wheel” is probably represented as an aggregate (and deserves a better identifier than a mere “front left”).</p><p>There are several more patterns illustrated in the original DDD book, but these examples should suffice to illustrate how domain models capture concepts of the underlying reality (the “domain”).</p><p>While the actual expression of the domain model in software depends on the programming paradigms used, the general idea is to first and directly map domain model concepts to concepts of the programming language. Thus, a bounded context might be represented by a software <em>module</em> (library, package, DLL, …), an entity by a <em>class</em>, a value object by a value object of the language (e.g. a <em>readonly record struct</em> in modern C#) while an aggregate has a relation to the <em>transaction</em> mechanism of the underlying persistence mechanism and might also be represented by a <em>class</em>. Rules could be represented as <em>methods</em> on objects, and guards on property setters, enforcing their validity.</p><p>Thus, there is an immediate correspondence from the knowledge captured in the domain model to the implementation of the software system.</p><h3>Benefits of Domain-Driven Design</h3><p><strong>Improved Software Maintainability</strong>: By aligning the structure of the software with the core domain concepts, DDD makes it easier to maintain and extend the system as new requirements arise. The software is organised in a way that makes sense to both developers and domain experts, leading to less confusion and a better understanding of how changes should be implemented.</p><p><strong>Reduced Long-Term Costs</strong>: One of the key trade-offs DDD makes is investing more effort upfront in understanding the domain, modelling, and strategic thinking. This can be seen as “more work today, less pain tomorrow.” It aims to avoid the technical debt that accumulates when systems are hastily built without understanding the domain thoroughly. This effort today results in fewer costly refactorings and rescues tomorrow — not just a few percent reduction in effort but often one or two orders of magnitude improvement.</p><p><strong>Business and Technical Alignment</strong>: DDD enables a tight alignment between the business needs and the software implementation. By encouraging a shared understanding of the domain and building software based on this shared model, teams are better equipped to deliver value that directly supports business goals. Several practices evolved as a spin-off, most notably <em>Event Sourcing</em> (as formulated by Greg Young and Udi Dahan), the Command-Query Responsibiliy Seggregation principle (<em>CQRS</em>, coined by Greg Young, building on Bertram Meyer’s CQS rule).</p><p><strong>Enhanced Team Collaboration</strong>: The emphasis on a ubiquitous language ensures that developers and business stakeholders can communicate effectively. The language removes ambiguity, allows better decision-making, and ensures that software accurately reflects business requirements. The best known present-day spin-off is the <em>Event Storming </em>domain model discovery method (by Alberto Brandolini).</p><p><strong>Adaptability to Changing Requirements</strong>: Through model-driven design and continuous refactoring, DDD emphasises keeping the software adaptable to change. As the domain evolves, the software evolves with it — ensuring that it remains relevant, maintainable, and scalable. This can be contrasted with a technology-based structure of the software system where the domain knowledge is rather implicitly spread out through the system; this results in changes requiring a lot of re-discovering the mental domain model based on the systems source code.</p><h3>The Cost of Domain-Driven Design</h3><p>It’s important to acknowledge that DDD is not without effort. It demands time and effort to communicate, to understand the domain deeply, and to model it properly. However, neglecting this upfront effort often leads to higher costs later — in refactoring, rescuing poor architecture, and struggling to maintain software that doesn’t fit the domain well.</p><p>For certain situations, such as building throwaway prototypes or working within a limited engagement where the team is not responsible for the system’s longevity, DDD may not be the most suitable approach. However, for product teams aiming to develop a sustainable, long-term solution, DDD can pay dividends.</p><h3>Conclusion: DDD as a Mindset, Not a Silver Bullet</h3><p>Domain-Driven Design is not a rigid set of rules that can simply be “applied” to any problem. Instead, it’s a mindset and a set of practices that describe how we can develop software effectively within the context of complex business domains. Its emphasis on understanding, modelling, and strategic thinking results in solutions that are adaptable, maintainable, and closely aligned with business needs.</p><p>Yes, DDD is more work, and yes, it comes with additional costs. But ultimately, these costs are often far less than what it would take to correct a misaligned system down the road — especially in the context of long-term <em>product</em> development where understanding, adaptability, and collaboration are the keys to success.</p><p>If you are building software that needs to last, adapt, and align with real business value, DDD is an approach worth exploring. And while there will always be trade-offs between short-term effort and long-term value, Domain-Driven Design offers a solid path towards building effective, robust, and meaningful software systems.</p><p>👉🏻 <em>Hey, if your read this far, I’d be grateful for feedback :) <br>This article is the start of a series leading towards practical design of business applications and I value your opinion. Please leave me a note. </em>🙏🏻</p><p><em>Disclaimers: All links in this article are non-affiliate. Being a non-native English speaker, I have used AI based tools to improve expression and grammar.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1025bce518c2" width="1" height="1" alt=""><hr><p><a href="https://domain-driven-software.com/an-introduction-to-domain-driven-design-ddd-1025bce518c2">An Introduction to Domain-Driven Design (DDD)</a> was originally published in <a href="https://domain-driven-software.com/">domain-driven-software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>