{"id":"6b08bd3280884893657cc92e","slug":"ddd-strategic-design","title":"DDD strategic design: subdomains, bounded contexts and context maps","summary":"The strategic part of Domain-Driven Design in practice: the ubiquitous language, core, supporting and generic subdomains, bounded contexts, context map patterns and the anticorruption layer. Examples in C#, TypeScript, Java, Go and Python.","servedLang":"en","availableLangs":["pl","en"],"topics":["ddd-strategic-design","modular-monolith","microservices"],"techs":["dotnet","java","typescript","go","python"],"tags":["architecture","ddd","bounded-context","context-map","subdomains","anticorruption-layer","event-storming"],"level":"advanced","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":12,"stats":{"views":4,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:13:54.075Z","updatedAt":"2026-11-27T13:16:27.052Z","requestedLang":"en","theme":{"hero":"classic","heroMedia":null,"accent":"teal","background":"hex","weaveResources":true,"toc":"right"},"seoDescription":"Strategic Domain-Driven Design: ubiquitous language, core/supporting/generic subdomains, bounded context, context map (partnership, shared kernel, customer-supplier, conformist, ACL, open host service, published language), Event Storming, module and microservice boundaries.","wordCount":2385,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"At Halina's pierogi place, the word \"order\" means something different to everyone. For the dining room it's an agreement with a customer: lines, prices, a discount, a payment. For the kitchen it's a ticket: what to cook, at which station and how long it will take. For delivery it's a run: an address, a courier, a time. For accounting it's a document with VAT. For years everyone used a single "},{"type":"text","text":"Order","marks":[{"type":"code"}]},{"type":"text","text":" class with eighty fields. "},{"type":"text","text":"Strategic Domain-Driven Design","marks":[{"type":"bold"}]},{"type":"text","text":" starts by admitting that this isn't one model but several – and each one needs its own boundaries."}]},{"type":"callout","attrs":{"variant":"tip","title":"In short"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"The domain is split into "},{"type":"text","text":"subdomains","marks":[{"type":"bold"}]},{"type":"text","text":": core (competitive advantage), supporting and generic – and effort is invested accordingly."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"A "},{"type":"text","text":"bounded context","marks":[{"type":"bold"}]},{"type":"text","text":" is a boundary within which the model and the "},{"type":"text","text":"ubiquitous language","marks":[{"type":"bold"}]},{"type":"text","text":" are consistent and unambiguous."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"A "},{"type":"text","text":"context map","marks":[{"type":"bold"}]},{"type":"text","text":" describes the relationships between contexts (and teams): who is the supplier, who conforms, where the "},{"type":"text","text":"anticorruption layer","marks":[{"type":"bold"}]},{"type":"text","text":" stands."}]}]}]}]},{"type":"stats","attrs":{"items":[{"value":"2003","label":"\"Domain-Driven Design\"","hint":"Eric Evans; strategic design is part four of the book"},{"value":"3","label":"kinds of subdomain","hint":"core, supporting, generic"},{"value":"9","label":"classic context map patterns","hint":"from partnership to the \"big ball of mud\""}]}},{"type":"heading","attrs":{"level":2,"id":"context-and-forces"},"content":[{"type":"text","text":"Context and forces"}]},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"One word, many meanings","marks":[{"type":"bold"}]},{"type":"text","text":" – the shared \"order\" model grows until nobody dares to change it."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"A limited budget","marks":[{"type":"bold"}]},{"type":"text","text":" – not every part of the system deserves a sophisticated model; payments and text messages are better bought."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Teams and communication","marks":[{"type":"bold"}]},{"type":"text","text":" – model boundaries should let teams work without constant negotiation."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Integrations with the outside world","marks":[{"type":"bold"}]},{"type":"text","text":" – courier platforms and payment gateways impose their own models, which shouldn't leak into ours."}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"In his 2003 book, Eric Evans devoted the \"Strategic Design\" part to these problems. They were later developed by, among others, Vaughn Vernon ("},{"type":"text","text":"Implementing Domain-Driven Design","marks":[{"type":"italic"}]},{"type":"text","text":", 2013, and "},{"type":"text","text":"Domain-Driven Design Distilled","marks":[{"type":"italic"}]},{"type":"text","text":", 2016) and Alberto Brandolini, the creator of Event Storming workshops."}]},{"type":"heading","attrs":{"level":2,"id":"subdomains-where-to-invest"},"content":[{"type":"text","text":"Subdomains: where to invest"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Kind"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Characteristics"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"In the pierogi place"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Strategy"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Core"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Sets the company apart from competitors, complex, changes often"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"production planning and catering: how much of what to make, in what order, at what margin"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"the best people, a rich model, tactical DDD"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Supporting"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Needed and specific, but gives no advantage"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"the loyalty programme, shift rota"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"a simpler model, own code or a customised product"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Generic"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Everyone has the same problem"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"payments, SMS, invoicing, sign-in"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"buy it or use a ready-made service, integrate through an anticorruption layer"}]}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"The classification isn't permanent: if Halina starts competing on 20-minute delivery, logistics may be promoted from a supporting to a core subdomain."}]},{"type":"heading","attrs":{"level":2,"id":"bounded-contexts-and-the-ubiquitous-language"},"content":[{"type":"text","text":"Bounded contexts and the ubiquitous language"}]},{"type":"paragraph","content":[{"type":"text","text":"The "},{"type":"text","text":"ubiquitous language","marks":[{"type":"bold"}]},{"type":"text","text":" is the vocabulary shared by domain experts and developers, used in conversations, documentation and code. The key caveat: it is ubiquitous "},{"type":"text","text":"within a context","marks":[{"type":"bold"}]},{"type":"text","text":". In the sales context an \"order\" has a price, in the kitchen context it doesn't – and that's fine. Trying to build one model for everyone ends with a model that fits nobody."}]},{"type":"codeGroup","attrs":{"title":"One word, two models in two contexts"},"content":[{"type":"codeBlock","attrs":{"language":"csharp","filename":"TwoContexts.cs"},"content":[{"type":"text","text":"namespace Pierogarnia.Sales\n{\n    // SALES context: an order is a commercial agreement with a customer.\n    public sealed record Order(CustomerId Customer, IReadOnlyList<OrderLine> Lines, Money Total, PaymentStatus Payment);\n}\n\nnamespace Pierogarnia.Kitchen\n{\n    // KITCHEN context: the same real-world thing is a ticket to cook. No prices, no customer data.\n    public sealed record KitchenTicket(\n        int Number,\n        IReadOnlyList<ToCook> ToCook,\n        TimeSpan PrepTime,          // what the kitchen actually cares about\n        Station Station);           // boiling, frying, packing\n\n    public sealed record ToCook(Dumpling Dumpling, int Pieces);\n}"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"two-contexts.ts"},"content":[{"type":"text","text":"// SALES context: an order is a commercial agreement with a customer.\nexport namespace Sales {\n  export interface Order {\n    customerId: string;\n    lines: { sku: string; quantity: number; unitPrice: Money }[];\n    total: Money; // prices, discounts, loyalty points\n    payment: \"pending\" | \"authorized\" | \"refunded\";\n  }\n}\n\n// KITCHEN context: the same real-world thing is a ticket to cook. No prices, no customer data.\nexport namespace Kitchen {\n  export interface KitchenTicket {\n    number: number;\n    toCook: { dumpling: Dumpling; pieces: number }[];\n    prepMinutes: number; // what the kitchen actually cares about\n    station: \"boiling\" | \"frying\" | \"packing\";\n  }\n}"}]},{"type":"codeBlock","attrs":{"language":"java","filename":"TwoContexts.java"},"content":[{"type":"text","text":"// SALES context (package pl.pierogarnia.sales): an order is a commercial agreement.\npublic record Order(CustomerId customer, List<OrderLine> lines, Money total, PaymentStatus payment) {}\n\n// KITCHEN context (package pl.pierogarnia.kitchen): the same thing is a ticket to cook.\n// No prices and no customer data - the kitchen doesn't need them, so the model doesn't have them.\npublic record KitchenTicket(int number, List<ToCook> toCook, Duration prepTime, Station station) {}\npublic record ToCook(Dumpling dumpling, int pieces) {}"}]},{"type":"codeBlock","attrs":{"language":"go","filename":"two_contexts.go"},"content":[{"type":"text","text":"// package sales: an order is a commercial agreement with a customer.\ntype Order struct {\n\tCustomer CustomerID\n\tLines    []OrderLine\n\tTotal    Money // prices, discounts, loyalty points\n\tPayment  PaymentStatus\n}\n\n// package kitchen: the same real-world thing is a ticket to cook.\ntype KitchenTicket struct {\n\tNumber   int\n\tToCook   []ToCook\n\tPrepTime time.Duration // what the kitchen actually cares about\n\tStation  Station       // boiling, frying, packing\n}"}]},{"type":"codeBlock","attrs":{"language":"python","filename":"two_contexts.py"},"content":[{"type":"text","text":"# sales/model.py: an order is a commercial agreement with a customer.\n@dataclass\nclass Order:\n    customer_id: str\n    lines: list[OrderLine]\n    total: Money  # prices, discounts, loyalty points\n    payment: PaymentStatus\n\n\n# kitchen/model.py: the same real-world thing is a ticket to cook. No prices, no customer data.\n@dataclass\nclass KitchenTicket:\n    number: int\n    to_cook: list[tuple[Dumpling, int]]\n    prep_time: timedelta  # what the kitchen actually cares about\n    station: Station      # boiling, frying, packing"}]}]}]},"toc":[{"id":"context-and-forces","text":"Context and forces","level":2,"locked":false},{"id":"subdomains-where-to-invest","text":"Subdomains: where to invest","level":2,"locked":false},{"id":"bounded-contexts-and-the-ubiquitous-language","text":"Bounded contexts and the ubiquitous language","level":2,"locked":false},{"id":"the-context-map","text":"The context map","level":2,"locked":true},{"id":"the-anticorruption-layer-in-code","text":"The anticorruption layer in code","level":2,"locked":true},{"id":"how-to-find-the-boundaries","text":"How to find the boundaries","level":2,"locked":true},{"id":"trade-offs","text":"Trade-offs","level":2,"locked":true},{"id":"in-practice","text":"In practice","level":2,"locked":true},{"id":"anti-patterns","text":"Anti-patterns","level":2,"locked":true},{"id":"related-topics","text":"Related topics","level":2,"locked":true},{"id":"test-yourself","text":"Test yourself","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":36,"visibleBlocks":12,"resources":[{"id":"6b0857c33c96f2d34d0b4669","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL4464385W","embedUrl":null,"title":"Domain-Driven Design","description":"","author":"Eric Evans","thumbnailUrl":"https://covers.openlibrary.org/b/id/5548424-L.jpg","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["general"],"tags":["book","software-architecture"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"2003-01-01T00:00:00.000Z","popularity":61,"verifiedAt":"2026-11-26T11:00:08.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"},{"id":"6b0857be3c96f2d34d0b41dc","type":"article","provider":"web","url":"https://www.domainlanguage.com/ddd/reference","embedUrl":null,"title":"DDD Reference - Domain Language","description":"A summary of the patterns and definitions of DDD. This document is meant as a convenient reference for those who know the principles of Domain-Driven Design (DDD). It does not contain full explanations of DDD or even of the terms and patterns covered. It is intended to be used as a complement to…","author":"Domain Language (Eric Evans)","thumbnailUrl":"https://domainlanguage.com/wp-content/uploads/2016/04/71QA9u88PdL-194x300.jpg","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["general"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":80,"verifiedAt":"2026-11-26T11:26:00.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857be3c96f2d34d0b41e9","type":"article","provider":"web","url":"https://martinfowler.com/bliki/BoundedContext.html","embedUrl":null,"title":"bliki: Bounded Context","description":"Don't try to build a single, unified model for a large domain. Instead DDD advises us to divide such a domain into many bounded contexts with explicit relationships between them.","author":"Martin Fowler","thumbnailUrl":"https://martinfowler.com/bliki/images/boundedContext/sketch.png","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["general"],"tags":["martin-fowler","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":75,"verifiedAt":"2026-11-26T11:07:11.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:59.965Z","updatedAt":"2026-11-26T16:00:59.965Z"},{"id":"6b0857c13c96f2d34d0b4490","type":"presentation","provider":"web","url":"https://speakerdeck.com/mploed/introduction-to-context-mapping-ddd-europe-2022","embedUrl":null,"title":"Introduction to Context Mapping (DDD Europe 2022)","description":"Context Maps, are a part of strategic Domain-driven Design whichs aims at delivering a holistic overview over the interactions between bounded conte…","author":"Michael Plöd","thumbnailUrl":"https://files.speakerdeck.com/presentations/de3ca805ba9d4ca59d541e573cc81825/slide_0.jpg?21835730","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["general"],"tags":["slides","software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":50,"verifiedAt":"2026-11-26T11:26:56.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:04.995Z","updatedAt":"2026-11-26T16:01:04.995Z"},{"id":"6b0857c43c96f2d34d0b46de","type":"book","provider":"openlibrary","url":"https://openlibrary.org/works/OL19546213W","embedUrl":null,"title":"Domain-Driven Design Distilled","description":"","author":"Vaughn Vernon","thumbnailUrl":"https://covers.openlibrary.org/b/id/8512313-L.jpg","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["general"],"tags":["book","software-architecture"],"price":"paid","featured":false,"featuredOrder":0,"packageName":null,"source":"openlibrary","publishedAt":"2016-01-01T00:00:00.000Z","popularity":40,"verifiedAt":"2026-11-26T11:00:08.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:07.480Z","updatedAt":"2026-11-26T16:01:07.480Z"},{"id":"6b0857c53c96f2d34d0b4857","type":"video","provider":"youtube","url":"https://www.youtube.com/watch?v=am-HXycfalo","embedUrl":"https://www.youtube-nocookie.com/embed/am-HXycfalo","title":"Bounded Contexts - Eric Evans - DDD Europe 2020","description":"Domain-Driven Design Europe 2020 - Organised by Aardling (https://aardling.eu/) https://dddeurope.com https://newsletter.dddeurope.com/ https://be.linkedin.com/company/domain-driven-design-europe https://bsky.app/profile/dddeu.bsky.social https://mastodon.social/@dddeu@m.aardling.social Bounded…","author":"Domain-Driven Design Europe","thumbnailUrl":"https://i.ytimg.com/vi/am-HXycfalo/hqdefault.jpg","durationSec":null,"lang":"en","topics":["ddd-strategic-design"],"techs":["general"],"tags":["software-architecture"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"youtube-rss","publishedAt":"2020-10-02T08:12:32.000Z","popularity":74,"verifiedAt":"2026-11-26T10:52:40.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:07.480Z","updatedAt":"2026-11-26T16:01:07.480Z"}],"challenges":[{"id":"6b093dc291bd8fbaf2a0c8d8","slug":"payment-circuit-breaker","title":"Circuit breaker for a payment gateway","summary":"A circuit breaker with closed, open and half-open states, an injected clock, a trial-success threshold and a business-error filter – so a payment gateway outage does not take the whole shop down.","servedLang":"en","availableLangs":["pl","en"],"kind":"code","category":"architecture","status":"published","difficulty":"hard","topics":["circuit-breaker","microservices"],"techs":["typescript","javascript","python","dotnet","java","go"],"tags":["circuit-breaker","resilience","fault-tolerance","state-machine","payments"],"languages":["typescript","javascript","python","csharp","java","go"],"questionCount":null,"xp":40,"stats":{"attempts":0,"solves":0,"solutions":0,"comments":0},"solveRate":null,"publishedAt":"2026-11-27T08:22:26.251Z"}],"attachments":[],"hasCode":true,"repoUrl":null,"series":[{"slug":"architecture-path","title":"From monolith to microservices","items":[{"slug":"monolith","title":"The Monolith: one application, one deployment, and why it is often the right start","current":false},{"slug":"modular-monolith","title":"The Modular Monolith: hard boundaries without the cost of the network","current":false},{"slug":"layered-architecture","title":"Layered architecture: presentation, logic, data – and where it breaks","current":false},{"slug":"hexagonal-architecture","title":"Pierogi in the Hexagon","current":false},{"slug":"clean-architecture","title":"Clean Architecture: the dependency rule and use cases at the centre","current":false},{"slug":"onion-architecture","title":"Onion architecture: the domain model in the middle, infrastructure outside","current":false},{"slug":"vertical-slice-architecture","title":"Vertical slice architecture: code by feature, not by layer","current":false},{"slug":"cqrs","title":"CQRS: one model for changing, another for reading","current":false},{"slug":"event-sourcing","title":"Event sourcing: store the facts, not just the latest state","current":false},{"slug":"event-driven-architecture","title":"Event-driven architecture: who publishes, who listens and what can go wrong","current":false},{"slug":"microservices","title":"Microservices: independent deployments, real costs and when it pays off","current":false},{"slug":"ddd-strategic-design","title":"DDD strategic design: subdomains, bounded contexts and context maps","current":true}]}],"prev":{"slug":"microservices","title":"Microservices: independent deployments, real costs and when it pays off"},"next":null,"featured":false,"authorCard":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","headline":"Wzorce projektowe · Architektura · AI i LLM","community":false,"reputation":{"points":3900,"level":{"key":"mentor","label":"Mentor"}},"articles":68,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Authority","articles":63},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Authority","articles":53},{"key":"python","title":"Python","level":5,"levelLabel":"Authority","articles":52},{"key":"java","title":"Java","level":5,"levelLabel":"Authority","articles":38}]}}