Subdomains: Core, Supporting, Generic
Before the first aggregate exists, you need to know where DDD pays off at all. Splitting the domain into Core, Supporting, and Generic subdomains decides how much effort, how experienced a team, and what technology each part of the application deserves.
In this chapter
02.01 Why subdomains come before everything else#
The developer reflex “I'll implement the whole thing properly” is expensive and, for most products, futile. Not every part of an application deserves the same depth of modeling. A team that models everything with the same care runs out of budget before it reaches what customers actually care about. In Domain-Driven Design (2003), in the chapter “Distillation,” Evans introduces a strategic filter for the whole domain and two of its concepts: Core Domain and Generic Subdomains [1]. Vaughn Vernon completed the trio in Implementing Domain-Driven Design (2013) with the term Supporting Subdomain [2]. Evans does use the word “supporting” in 2003, but only descriptively; it does not appear as a named pattern in the book or in the DDD Reference (2015). Before you write your first aggregate or value object, you need to know which part of the domain is your competitive advantage, which is merely necessary, and which makes no sense to write at all. Today this filter is known as splitting the domain into Core, Supporting, and Generic subdomains.
The business idea is older than DDD. In Living on the Fault Line (2000), Geoffrey Moore divides a company's activities into core, which sets it apart, and context, meaning everything else the company must do to stay in the market. In Dealing with Darwin (2005), he drew a rule from it: minimize, automate, or outsource context. Evans's distillation says the same thing in the language of the model.
A subdomain is not the same as a Bounded Context, although the two terms are routinely confused in conversation. A Bounded Context is an implementation boundary: the place where one Ubiquitous Language, one consistent model, and typically one team apply. Whether it runs as a separate service or as a module of a monolith is an operational decision. A subdomain bounds the business. It is a piece of the problem that the organization handles as one coherent chapter. The relationship between them is not 1:1. One subdomain (“Pricing”) can split into several BCs: Catalog computes an indicative price, Checkout a binding price with discounts. Conversely, one BC can cover several small subdomains; a Backoffice, for example, usually bundles bits of reporting, invoicing, and user management.
The dividing line between the two is not sharp. The shorthand “the business discovers subdomains, engineers design contexts” is easy to remember, but it is not quite accurate: a subdomain's boundary often becomes clear only once the team starts modeling.
Vernon puts it pragmatically in chapter 2 of Implementing Domain-Driven Design (2013) [2]: the domain is the organization's entire problem space; a subdomain is a logical part of it; a Bounded Context is the solution you design for it. Vlad Khononov opens his whole account in Learning Domain-Driven Design (O'Reilly 2021) with the classification of subdomains, in chapter 1, “Analyzing Business Domains” [3]. It is also the cheapest tool in DDD: it costs a single workshop and can reallocate a budget worth millions.
A mistake in classifying a subdomain costs many times more than a mistake in a single aggregate, which is why the introductory chapter puts strategic design before tactical design. A badly designed aggregate gets refactored in two sprints. A misclassified Core Domain means a year of development in the wrong area, and a year the real differentiator went without. Filtering therefore comes before modeling.
02.02 Three categories of subdomains#
The split is deliberately coarse: three boxes, no shades. Once the investment decision is made, the details belong to the tactical level (Aggregate, Repository, Domain Service). The strategic level needs only enough granularity to say: we invest in this category, not in that one.
Core Domain
The part of the domain that forms the organization's competitive advantage, the reason customers pay you and not someone else. Test: “If we pull back from this tomorrow, we lose customers.” Put the other way: if the same functionality could be bought from a vendor just as cheaply, it is not Core but Generic.
Consequences for the team and the stack: full tactical design (Aggregate, Value Object, Domain Event), a senior team, in-house IP, and low tolerance for external dependencies in the core. This is also where the most automated tests, the strictest code review, and the most frequent discussions with domain experts belong. Khononov's examples [3] are Uber's ridesharing and driver matching and Google's search ranking algorithm. Both are Core for their company, because that is exactly how each differs from the market. Khononov adds a second criterion that competitive advantage alone does not cover: a Core subdomain with low complexity provides only a short-term advantage, because competitors catch up. Core subdomains are therefore inherently complex.
Supporting Subdomain
The part of the domain that is necessary for operations but does not differentiate you. Test: “We need it, but nobody hires us because of it.” Classic examples: order management in an online store, inventory records, invoicing, and management reporting. If Supporting worked “the same as at the competition,” nobody would notice. If it did not work at all, operations would grind to a halt.
Consequences for the team and the stack: light DDD (often a Transaction Script or CRUD over Doctrine entities is enough), a junior to mid-level team, and a willingness to reach for ready-made solutions where possible. The goal is to work reliably with minimal maintenance cost, not to have the prettiest model. A test serves better than a blanket rule. For a Supporting subdomain that cannot be bought off the shelf as Generic, tactical design pays off under three conditions: the team can handle it, the model is innovative, and it has to last for years. Where these conditions do not hold, the organization spends senior time on something nobody cares about. The test is this book's own construction; Vernon [2] gives the more general guidance that Supporting deserves less modeling effort than Core.
Generic Subdomain
The part of the domain that is commoditized. Test: “The solution has existed for 30 years, it is sold in a box or in the cloud, we buy it.” Classic examples: user authentication, sending transactional emails, payment gateway integration, generating PDF invoices, full-text search, and spam filtering. The default choice is to buy, not write. Evans is more cautious here than is usually assumed: he lists an in-house implementation among four acceptable sourcing options, and he writes that off-the-shelf solutions usually do not pay off but are worth investigating [1]. Custom code is therefore defensible where the integration cost exceeds the implementation cost. Where no such reason exists, custom code reinvents the wheel at the Core Domain's expense.
Consequences for the team and the stack: SaaS, an open-source library, an external API, or a thin bridge / Anti-Corruption Layer between our model and the commodity solution. Integrations with Auth0 / Keycloak, Stripe, Mailgun, AWS SES, and Algolia belong here. Size rule of thumb: if a particular Generic subdomain consumes more than 5–10% of development capacity, either the chosen product is a poor fit or the subdomain is misclassified. The number is the author's own; no primary source gives it, and the same goes for the other percentages in this chapter.
Three axes, not one
Competitive advantage is only the first axis. Khononov adds two more, complexity and volatility, and only the full trio separates Generic from Supporting by something other than “there's a SaaS for it” [3].
| Type | Competitive advantage | Complexity | Volatility | Sourcing |
|---|---|---|---|---|
| Core | yes | high | high | build in-house |
| Supporting | no | low | low | build in-house or outsource |
| Generic | no | high | low | buy / adopt off the shelf |
Core and Generic are both complex. The difference is that Generic is a complex solved problem that does not change: cryptography, OAuth, and email deliverability. A Supporting subdomain, by contrast, is simple by nature: forms, lists, two or three states. The label “glorified CRUD” fits it.
The table yields a diagnostic question that a single-axis classification cannot ask: complexity in a Supporting subdomain is a signal. Either an unrecognized Core subdomain is hiding in it, or it is accidental complexity that nobody wanted there. Nick Tune calls the combination of high complexity and zero differentiation Suspect Supporting [6]. In legacy projects, it tends to be the most common finding of the whole exercise.
Volatility is the third axis, and it drives the architecture. Rules that change every sprint need a model that can absorb change; rules that have not changed in ten years get by with a table and one service object. Khononov's decision chain (subdomain type → business logic pattern → architectural style) is covered in the chapter on when not to use DDD.
Distillation beyond classification
The Core / Supporting / Generic classification is the first step of Evans's distillation, not the whole procedure. Chapter 15, “Distillation,” of Domain-Driven Design contains seven patterns: CORE DOMAIN, GENERIC SUBDOMAINS, DOMAIN VISION STATEMENT, HIGHLIGHTED CORE, COHESIVE MECHANISMS, SEGREGATED CORE, and ABSTRACT CORE. The Domain Vision Statement is covered in section 02.09. Abstract Core is the most expensive of the set: it pulls the most general domain concepts into a separate module and pays off only for a model that, by its fourth year, has grown too large for the team to read. The remaining three techniques are the first to reach for:
Highlighted Core. The core elements are marked directly in the existing model: with a short distillation document (a few pages) or by highlighting in documentation and code, without refactoring. It is the cheapest distillation technique. It fits when the team needs a shared awareness of what the core is but has neither the time nor the mandate for structural changes.
Segregated Core. A refactoring that moves the core concepts into a separate module and cuts them off from supporting code. It pays off when Core is so tangled up with Supporting classes that nobody can see it in the model, and every change to the core drags the periphery along. The price is a rewrite, and the investment pays back only for a genuine Core Domain.
Cohesive Mechanisms. A computationally complex but conceptually separable mechanism (a graph algorithm, a recalculation engine) is extracted into a separate lightweight framework. The domain model then declares what is computed; the mechanism handles how. It comes into play once the technical “how” starts to overshadow the domain “what” in the model.
02.03 How to recognize the Core Domain: a five-point test#
Recognizing the Core Domain is the hardest step. Teams tend to declare everything “strategically important,” and the term Core Domain is reduced to an empty label.
The following five-point test is this book's own construction, not a heuristic taken from a primary source. Khononov distinguishes subdomain types along three axes: competitive advantage, business logic complexity, and volatility [3]. For the two axes of its Core Domain Charts, ddd-crew offers a catalog of nine questions [5]. The test below simplifies both into a quick filter that one person can run over coffee. Score each item YES/NO. Three or more YES answers mark a Core Domain candidate; otherwise it is Supporting or Generic.
-
“If we outsourced this, would we lose our main product?”
If YES (= without this functionality we have nothing to sell) → it is a Core candidate. If NO → it is not Core. Example: an online store can outsource payments (not Core), but it cannot outsource its product range and the way it recommends products (a Core candidate).
-
“Does this area lack a market benchmark / standard?”
If NO (a standard exists) → very likely Generic. A standard means someone has already solved the problem and the market has agreed on what the solution should look like. Examples: OAuth 2.0 / OpenID Connect for authentication, ISO 8583 for card payments, RFC 5321 for SMTP. If YES, the result is neutral: it can be either Core or Supporting. Question 2 only rules out: a NO points to Generic regardless of the rest; a YES does not count toward the total.
-
“Are we already writing this for the second time, differently from the competition?”
If YES → a strong Core indicator. Developing something “differently from everyone else” is expensive and pays off only when the difference brings a market advantage. If we do something differently without a tangible advantage, it is often a misclassified subdomain for which a standard solution should have been bought.
-
“Does the CEO / VP of product talk about this every week?”
If YES → a strong Core indicator. Top management does not concern itself with Supporting subdomains; it hears about them only when they stop working. When the CEO keeps making decisions about a particular piece of functionality, it is most likely a competitive differentiator. When not, it is more likely operations.
-
“Do we plan to experiment / change the rules often in this area?”
If YES → a Core indicator. The frequency of change reveals how hard the market is contested in that area. In Generic subdomains, the rules do not change. Authentication works this year the same as last year. In the Core Domain, the team tests, runs A/B measurements, and iterates on domain rules, because the advantage lies in the iteration itself.
The test has one useful side effect: it forces business reasons to be stated before technical ones. If the team answers question 4 (“does the CEO talk about it?”) with “we don't know, we didn't ask,” that is a sign the strategic conversation has to happen before implementation starts.
Core Domain Charts: three boxes as a continuous plane
The five-point test gives a YES/NO answer. The ddd-crew community's Core Domain Charts draw a two-axis chart instead: the vertical axis is complexity, the horizontal one business differentiation [5]. Subdomains are placed on it as points, not as items in three bins. Core, Supporting, and Generic then stop being boxes and become regions of one plane. A subdomain lying between them is no longer a classification problem; it becomes a topic for conversation.
According to the authors, that conversation is where the technique's main value lies. Engineers can estimate complexity; product or the business supplies differentiation. The chart is the only place where both groups have to put their estimates side by side. The template offers a catalog of questions for both axes. For complexity, it separates essential domain complexity from accidental technical and operational complexity. For differentiation, it asks separately about the difficulty for a market newcomer and for an existing competitor.
A practical division of roles: the test from the previous section as a quick filter for individuals, the chart as a workshop output the team hangs on the wall and redraws a year later to show the shifts.
02.04 Anti-pattern: “everything is Core”#
The most common mistake in strategic DDD is not a badly designed aggregate but “everything is Core.” The tendency toward it is psychological. Every developer you ask whether their area is strategic will say YES. The reasons: ego, career worries about an “unimportant” area, and a general tendency to overrate one's own work. Every piece of functionality has its hero who defends it as essential to the company. Event Storming workshops show the phenomenon clearly [4].
The management level makes things worse. A director without a technical background hears from every team lead that their area is strategic. The director has no tool to judge where the investment is justified and where it is turf defense. The budget then spreads evenly, and Core gets the same as invoicing. A smaller competitor that concentrates five times as much on its real Core overtakes such a company.
The third dimension is technical. If “everything is Core,” the result is a monolithic domain model without priorities: every entity is first-class, every use case has its own aggregate, every action has a domain event. Refactoring one corner touches twenty others, performance suffers, and the tests run for an hour. A healthy DDD application, by contrast, has a sharply defined hierarchy: a few aggregates in Core, light models in Supporting, and thin adapters in Generic.
The defense against the “everything is Core” anti-pattern is straightforward: impose a budget. Before each quarter (or OKR cycle) starts, draw three boxes: Core / Supporting / Generic. In each, write its percentage share of total development capacity. If 80% lands in Core, the classification has failed. The distribution this book assumes for an average B2B SaaS company: 20–30% Core, 50–60% Supporting, 10–20% Generic. It is a rule of thumb calibrated on mid-sized products, not measured data. The last number tends to be the lowest – by definition, Generic is not written, only integrated.
02.05 Mapping subdomains to Bounded Contexts#
Subdomains map to Bounded Contexts through three standard relationships: 1:1 (one subdomain = one BC, the desirable state), 1:N (one subdomain splits into several BCs), and N:1 (several small subdomains live in one BC, common for Supporting / Generic). Vernon recommends aiming for 1:1 wherever possible. Khononov goes further and warns against splitting coherent functionality: the contexts then cannot evolve independently, because the same change in requirements hits both and forces a simultaneous deployment. A legitimate reason to split remains the need to separate development cycles or to scale one part independently of the rest; that, however, is this book's recommendation, not his wording [3].
As an illustration, here is an imaginary mid-sized online store (3–4 teams, 25 developers) broken down into subdomains and Bounded Contexts:
| Subdomain | Classification | Bounded Context(s) | Relationship | Note |
|---|---|---|---|---|
| Pricing & Promotions | Core | Catalog BC, Checkout BC | 1:N | Split for operational reasons: listing and checkout scale and deploy at different paces. |
| Personalized Recommendations | Core | Recommendation BC | 1:1 | Its own ML model + a read-only projection of purchases from the other BCs. |
| Order Management | Supporting | Ordering BC | 1:1 | A clear boundary, light DDD. |
| Inventory | Supporting | Warehouse BC | 1:1 | Stock levels, reservations, goods receipts. |
| Customer Support | Supporting | Support BC (Zendesk + ACL) | 1:1 via ACL | Off-the-shelf SaaS, an Anti-Corruption Layer for mapping IDs and customers. |
| Identity / Auth | Generic | External IdP (Auth0) | 1:1 via ACL | No internal BC, only a thin bridge and a UserProvider. |
| Payments | Generic | External (Stripe / Adyen) | 1:1 via ACL | A webhook subscriber, mapping to our PaymentIntent. |
| Email Delivery | Generic | External (AWS SES / Mailgun) | 1:1 via ACL | Symfony Mailer + a transport bundle. |
| Reporting / Analytics | Supporting | Analytics BC | N:1 | Several small subdomains (Sales, Stock, Marketing) share one BC with read models. |
The table illustrates a typical breakdown: Core has its own heavily modeled BCs, Supporting has 1:1 BCs with lighter design, and Generic takes over someone else's BC (an external provider) through an Anti-Corruption Layer. A radically different breakdown (e.g., 5 Core BCs and no Generic) is a signal that the classification needs to be checked again. If you are still looking for boundaries, start with Big Picture Event Storming; if your boundaries already fit and the question is which team gets what, continue with the chapter on Team Topologies.
02.06 Subdomains in Symfony: what they mean for project structure#
Symfony 8 gives you complete freedom in the directory structure under src/. The default split into src/Controller/, src/Entity/, and src/Repository/ is technical: it sorts code by layer. For a DDD application, that is a mistake, because you cannot tell at first glance which subdomain a piece of functionality belongs to. A junior looking for “how the price is calculated” has to go through all three directories. A better way: structure src/ primarily by subdomain, and secondarily by layer within each subdomain.
A concrete layout in a Symfony 8 online store:
1src/2├── Core/3│ ├── Pricing/ ← full DDD: Aggregate, VO, Domain Event4│ │ ├── Domain/5│ │ │ ├── Aggregate/Pricelist.php6│ │ │ ├── ValueObject/PriceRule.php7│ │ │ ├── Event/PricelistCreated.php8│ │ │ ├── Event/PricelistChanged.php9│ │ │ ├── Exception/ConflictingPriceRuleException.php10│ │ │ └── Repository/PricelistRepository.php (interface)11│ │ ├── Application/12│ │ │ ├── Command/UpdatePrice.php13│ │ │ └── Handler/UpdatePriceHandler.php14│ │ └── Infrastructure/15│ │ ├── Doctrine/DoctrinePricelistRepository.php16│ │ └── Symfony/PricingMessageHandler.php ← receives integration messages17│ └── Recommendations/ ← analogous structure18│19├── Supporting/20│ ├── Ordering/ ← light DDD: minimal Aggregate, Doctrine ORM21│ │ ├── Domain/22│ │ │ ├── Order.php (Doctrine entity + behavior)23│ │ │ └── OrderRepository.php (interface)24│ │ ├── Application/25│ │ │ └── PlaceOrderHandler.php26│ │ └── Infrastructure/27│ │ └── Repository/DoctrineOrderRepository.php28│ ├── Inventory/29│ └── Reporting/30│31└── Generic/32 ├── Auth/ ← bridge to Auth0, no custom Aggregate33 │ ├── Adapter/Auth0Client.php34 │ ├── Adapter/Auth0UserProvider.php35 │ └── Adapter/Auth0AuthenticationListener.php36 ├── Mail/37 │ └── Adapter/SesMailerAdapter.php38 └── Payment/39 └── Adapter/StripeWebhookHandler.php
The structural difference mirrors the strategic one: Core has three layers (Domain / Application / Infrastructure), Supporting also has three but thinner ones, and Generic has only one – Adapter. A junior who decides to add SomeBusinessRule.php to src/Generic/Auth/ runs into the missing Domain/ directory and gets a signal that the code does not belong there. An aggregate in src/Core/Pricing/Domain/, on the other hand, has the whole domain infrastructure around it, and the team works with its invariants in depth.
This structure has a price, though. Section 02.08 shows that the classification ages and gets reassessed every 12–18 months. But reclassifying Pricing from Core to Supporting in this structure means renaming a namespace across the entire project – exactly the kind of change a team postpones. Classification written into the path is the most instructive variant and the most fragile one to operate.
The second variant puts the domain name at the top level and leaves the classification to the documentation:
1src/2├── Pricing/ ← Core (see docs/domain/pricing.md)3│ ├── Domain/4│ ├── Application/5│ └── Infrastructure/6├── Ordering/ ← Supporting7├── Inventory/ ← Supporting8└── Auth/ ← Generic, Adapter/ only
Matthias Noback describes this one in his series Layers, ports & adapters (2017): a directory for each Bounded Context directly under src/, with the layers inside it. When Pricing moves to Supporting, the path src/Pricing/ stays the same. Only the depth of the model inside changes, perhaps with a few classes fewer, and nobody has to rewrite use statements across the project. The price is paid elsewhere: nobody can read the classification from the directory tree anymore, so it has to live in the Core Domain Chart and in the Domain Vision Statements. The rest of the book uses this second variant: from DDD Building Blocks onward, it is App\Ordering\, App\UserManagement\, and so on everywhere, with the context at the top level. This chapter shows the split by classification because it makes the chapter's topic visible. As a project skeleton, though, it would diverge from the rest of the book.
Autoloading needs no special mapping. The Symfony skeleton's default PSR-4 rule App\ → src/ covers App\Core\, App\Supporting\, App\Generic\, and App\SharedKernel\. A mapping to only these four prefixes without App\, on the other hand, would drop App\Kernel in src/Kernel.php from the autoloader:
1{2 "name": "acme/eshop",3 "type": "project",4 "require": {5 "php": ">=8.4",6 "symfony/framework-bundle": "^8.0",7 "doctrine/orm": "^3.0",8 "symfony/messenger": "^8.0"9 },10 "autoload": {11 "psr-4": {12 "App\\": "src/"13 }14 },15 "autoload-dev": {16 "psr-4": {17 "App\\Tests\\": "tests/"18 }19 }20}
The App\SharedKernel\ namespace is for genuinely shared primitives: the AggregateRoot base class, DomainEvent, Money, and generic identifiers. All subdomains use them, and they belong to none of them. The book uses it this way in later chapters too. A shared kernel does tend to grow into the “everything is shared” anti-pattern, though; the risks and rules are covered in the Shared Kernel section of the chapter on Context Mapping.
In config/services.yaml, each subdomain then usually gets its own resource block. This keeps the DI definitions isolated at the subdomain level:
1services:2 _defaults:3 autowire: true4 autoconfigure: true5 6 # Core subdomains: explicit interface binding7 App\Core\Pricing\:8 resource: '../src/Core/Pricing/'9 exclude:10 - '../src/Core/Pricing/Domain/Event/'11 - '../src/Core/Pricing/Domain/ValueObject/'12 13 App\Core\Pricing\Domain\Repository\PricelistRepository:14 alias: App\Core\Pricing\Infrastructure\Doctrine\DoctrinePricelistRepository15 16 # Supporting: standard autowiring17 App\Supporting\:18 resource: '../src/Supporting/'19 20 # Generic: adapters only, no domain classes21 App\Generic\:22 resource: '../src/Generic/'
An aggregate in a Core subdomain, with the depth of modeling Core deserves:
1<?php2 3declare(strict_types=1);4 5namespace App\Core\Pricing\Domain\Aggregate;6 7use App\Core\Pricing\Domain\Event\PricelistChanged;8use App\Core\Pricing\Domain\Event\PricelistCreated;9use App\Core\Pricing\Domain\Exception\ConflictingPriceRuleException;10use App\Core\Pricing\Domain\ValueObject\PriceRule;11use App\SharedKernel\Domain\AggregateRoot;12use App\SharedKernel\Domain\Money;13use Symfony\Component\Uid\Uuid;14 15final class Pricelist extends AggregateRoot16{17 /** @var list<PriceRule> */18 private array $rules = [];19 20 private function __construct(21 private readonly Uuid $id,22 private readonly string $name,23 ) {24 }25 26 public static function create(string $name): self27 {28 $pricelist = new self(Uuid::v7(), $name);29 $pricelist->record(new PricelistCreated($pricelist->id, $name));30 31 return $pricelist;32 }33 34 public function applyRule(PriceRule $rule): void35 {36 if ($this->hasConflictingRule($rule)) {37 throw ConflictingPriceRuleException::forCode($rule->code);38 }39 40 $this->rules[] = $rule;41 $this->record(new PricelistChanged($this->id, $rule));42 }43 44 public function priceFor(Money $listPrice, array $context): Money45 {46 $price = $listPrice;47 foreach ($this->rules as $rule) {48 if ($rule->matches($context)) {49 $price = $rule->apply($price);50 }51 }52 return $price;53 }54 55 private function hasConflictingRule(PriceRule $candidate): bool56 {57 foreach ($this->rules as $rule) {58 if ($rule->conflictsWith($candidate)) {59 return true;60 }61 }62 return false;63 }64}
For comparison, the equivalent in a Supporting subdomain (Order Management) is considerably lighter: a Doctrine entity with a few methods and no separate value objects, because the invariants are trivial. This is deliberately the same Order that the chapter on aggregate design models as a full aggregate with Order::place(), CustomerId, and Money. Neither example is the one correct version; they differ in classification. In an online store with its own pricing engine, orders are Supporting; in a logistics company, they are Core – and the model adapts accordingly. In the same spirit, the bare \DomainException below is an acknowledged shortcut: named exceptions belong where someone builds a reaction on them, not in a three-state workflow.
1<?php2 3declare(strict_types=1);4 5namespace App\Supporting\Ordering\Domain;6 7use Doctrine\ORM\Mapping as ORM;8use Symfony\Component\Uid\Uuid;9 10#[ORM\Entity]11#[ORM\Table(name: "orders")]12class Order13{14 #[ORM\Id]15 #[ORM\Column(type: "uuid")]16 private Uuid $id;17 18 #[ORM\Column(length: 32)]19 private string $status = "pending";20 21 #[ORM\Column(type: "decimal", precision: 12, scale: 2)]22 private string $total;23 24 public function __construct(Uuid $id, string $total)25 {26 $this->id = $id;27 $this->total = $total;28 }29 30 public function confirm(): void31 {32 if ($this->status !== "pending") {33 throw new \DomainException("Order is not pending.");34 }35 $this->status = "confirmed";36 }37 38 public function cancel(): void39 {40 if ($this->status === "shipped") {41 throw new \DomainException("Cannot cancel shipped order.");42 }43 $this->status = "cancelled";44 }45 46 public function getId(): Uuid { return $this->id; }47 public function getStatus(): string { return $this->status; }48 public function getTotal(): string { return $this->total; }49}
The Doctrine uuid type is not part of ORM 3. The Symfony Doctrine bridge provides it, and DoctrineBundle registers it on its own as soon as symfony/uid is installed. Without that package, the mapping #[ORM\Column(type: "uuid")] fails with an “unknown type” exception. The explicit registration below therefore changes nothing in a project with DoctrineBundle; it only makes the type visible in the configuration.
1doctrine:2 dbal:3 types:4 uuid: Symfony\Bridge\Doctrine\Types\UuidType
And in a Generic subdomain (the Auth0 integration), there is neither an entity nor an aggregate. With a bit of luck, there is not even a custom adapter: the auth0/symfony package ships a ready-made Auth0\Symfony\Security\UserProvider and an authenticator, so the whole subdomain shrinks to configuration.
1security:2 providers:3 auth0_provider:4 id: Auth0\Symfony\Security\UserProvider5 6 firewalls:7 main:8 provider: auth0_provider9 custom_authenticators:10 - auth0.authenticator
You write a custom UserProvider only when the ready-made one is not enough, typically because you need to enrich the Auth0 profile with internal data. Even then, it stays a thin adapter that implements an interface from Symfony Security and models nothing:
1<?php2 3declare(strict_types=1);4 5namespace App\Generic\Auth\Adapter;6 7use Auth0\SDK\Auth0;8use Symfony\Component\Security\Core\Exception\UserNotFoundException;9use Symfony\Component\Security\Core\User\UserInterface;10use Symfony\Component\Security\Core\User\UserProviderInterface;11 12final class Auth0UserProvider implements UserProviderInterface13{14 public function __construct(private readonly Auth0 $auth0)15 {16 }17 18 public function loadUserByIdentifier(string $identifier): UserInterface19 {20 $response = $this->auth0->management()->users()->get($identifier);21 if ($response->getStatusCode() === 404) {22 throw new UserNotFoundException();23 }24 $profile = json_decode((string) $response->getBody(), true, 512, JSON_THROW_ON_ERROR);25 26 return new Auth0User($profile);27 }28 29 public function refreshUser(UserInterface $user): UserInterface30 {31 return $this->loadUserByIdentifier($user->getUserIdentifier());32 }33 34 public function supportsClass(string $class): bool35 {36 return $class === Auth0User::class;37 }38}
The same kind of task three times – working with a domain object – and each time a radically different amount of code. That is how the investment decision shows up in the code.
02.07 Subdomains and sourcing strategy (build / buy / partner)#
A classification is worth something only when decisions follow from it. It maps directly onto sourcing strategy (who writes the code, and how):
| Classification | Recommended strategy | Team | Examples |
|---|---|---|---|
| Core | BUILD in-house (own IP, full control) | Senior + domain expert | Pricing engine, Recommendation, Risk scoring |
| Supporting | BUILD light or BUY a ready-made solution, if one exists with ≥80% coverage | Mid-level, junior under supervision | Order mgmt (build), Helpdesk (buy – Zendesk) |
| Generic | BUY / RENT / OPEN-SOURCE | Junior, integrator | Auth (Auth0/Keycloak), Email (SES), Payments (Stripe) |
The classification is relative to the business model, not absolute. What is Generic for you is the vendor's Core, as the Mailgun and authentication examples above showed.
For a Generic subdomain, “buy” takes four forms, which Evans distinguished back in 2003 and which in practice get blurred into one [1]:
- Off-the-shelf solution. The fastest route, but you pay with integration and with a foreign model imposing its vocabulary. Evans's verdict is cautious: it usually does not pay off, but it is worth investigating.
- Published design or model. The design is someone else's, the code is yours. Evans points to Fowler's Analysis Patterns; today's equivalents are standards such as OpenID Connect or ISO 20022.
- Outsourced implementation. The specification goes out, integration and maintenance stay in-house. It saves senior team capacity, but adds communication overhead and code review costs.
- In-house implementation. You get exactly what you want, nothing more, and integration falls away. The price is maintenance forever.
Sourcing by strategic value is not a DDD discovery, either. In Stand Back and Deliver (2009), Niel Nickolaisen described the Purpose Alignment Model with two axes, mission critical and market differentiating [8]. Its four quadrants map onto the table above almost literally. Differentiating (excel) corresponds to Core, Parity (simplify and standardize) covers both Supporting and Generic. Partner is the option described below, and Who cares is work the team should do as cheaply as possible, or not at all.
For purchasing decisions, this leads to one question to ask before signing a SaaS contract: “Are we buying Generic, or outsourcing Core?” If the SaaS covers Generic, it is a clear gain: we save time, buy the vendor's experience, and focus on Core. If the SaaS were to cover Core, it is a strategic retreat: we hand our competitive advantage to a third party. The same decision, but with the opposite sign.
Besides BUILD and BUY, there is a third option: partnership. It fits Supporting subdomains where a ready-made solution exists, but you need more customization than a standard SaaS allows. Example: an online store integrates invoicing through the API of another fintech company that, for a monthly fee, calculates taxes for 30 jurisdictions. Partnership differs from buying in that it is not a boxed product, and from in-house development in that someone else's team writes the code. It carries the risk of long-term dependency and requires contractual guarantees (data ownership, an exit clause, an SLA) and an Anti-Corruption Layer at the boundary.
02.08 How subdomains evolve over time#
Classifying subdomains is not a one-off exercise. Within a few years, the market and technology shift enough that Core can turn into Supporting. Khononov devotes a separate section of Learning DDD to this: he describes how a subdomain's type shifts, how to recognize the shift, and how to respond to it [3]. The claim that a neglected re-evaluation costs as much as a wrong first classification is this book's own conclusion.
The shifts have names. Nick Tune collected them as Core Domain Patterns, and his vocabulary serves better than three static categories [6]. A former innovation that no longer differentiates but is still needed he labels Table Stakes / Former Core. A core that has become a capability available to anyone he calls Commoditised Core. The opposite movement got the name Black Swan Core: something unexpected happens and an apparent commodity turns into a core overnight. Hidden Core is a core the team overlooked precisely because it looks inconspicuous: high differentiation at low complexity.
Susanne Kaiser described the mechanism behind these shifts by connecting the classification to Wardley's evolution axis, genesis → custom-built → product → commodity [9]. Core starts in genesis or custom-built, Supporting tends to be custom-built or product, and Generic sits in product to commodity. Movement along the axis goes in one direction and prescribes the method directly: what is in genesis gets built in-house; what has reached product gets bought; what is a commodity gets rented. The shifts below are different places on the same axis.
From Generic to Core: a commodity becomes a differentiator
Example: online payments in 2010 were Generic for most companies. You buy a gateway, integrate it, done. For Stripe, which was a young company at the time, it was Core: it invested in the API, in developer support, and in global coverage. This does not contradict the one-way Wardley axis: Stripe did not buy payments as a commodity but built a new product out of them. Today Stripe is more or less an industry standard, and the core of its business remains payments; only the bar has moved (fraud detection, tax compliance, financial products for startups). When a company finds that a previously generic area can be a place to compete in the market, it makes sense to move it into Core and increase the investment. The risk: if you are wrong, you spend money on a subdomain the market does not value at all.
From Core to Supporting: commoditization
Example: file synchronization. In 2008, file synchronization was exactly where Dropbox's Core lay. It was a nasty problem with race conditions, latencies, and propagating binary diffs that nobody solved well at the time. Since the arrival of Google Drive, OneDrive, and iCloud Drive (2012–2014), synchronization has been a commodity that platforms bundle with an operating system or an office suite. Dropbox therefore had to move its Core elsewhere, into productivity tools (Paper, integrations), to stay differentiated. Once a Core Domain is available as a service from three big vendors, it is time to cut the investment, refactor the model into a lighter one, and look for a new differentiator.
From Supporting to Generic: when a quality SaaS arrives
Example: helpdesk / ticketing. In 2005, many mid-sized companies wrote their own helpdesk module as a Supporting subdomain. Today Zendesk, Freshdesk, or Intercom cover 90% of requirements, and an in-house implementation does not pay off. Ticketing itself has thus moved from Supporting to Generic, and a team that keeps maintaining it in-house is wasting budget. What stays Supporting are only the company's own support rules running on top of it (escalation, links to orders). That is why Customer Support in the table in section 02.05 is classified as Supporting with an off-the-shelf SaaS behind an ACL.
Where language models moved the Generic boundary
The latest shift is recent, and it hit a whole class of tasks at once. Text classification, data extraction from unstructured documents, summarization, linguistic normalization of input: as late as 2020, these were Supporting subdomains staffed by a dedicated team with its own model. Today they are an API call. The economics of the decision have flipped. Where the only route used to lead through an in-house implementation, a ready-made solution now exists. Its quality improves faster than a team could write its own.
No primary DDD source offers hard numbers on this shift yet, so it is an observation, not a documented trend. The practical impact is clear, though: subdomains built around text processing belong first in line for the next audit. The context is covered in the chapter on DDD and AI.
A practical defense against an outdated classification:
- Schedule a strategic subdomain audit every 12–18 months. A half-day workshop with product management and architects.
- After each audit cycle, run the five-point test (section 02.03) on all subdomains again – including the ones you are “sure about.”
- Compare with the competition: if your biggest competitor neutralizes your Core subdomain (e.g., by buying a ready-made solution that covers 80% of your scope), that is a warning sign.
- Watch the SaaS market in Generic subdomains – what was “buy it” last year may this year be “everyone has it and it costs a twentieth.”
02.09 A practical procedure, step by step#
A five-step procedure for the first classification of your own product's subdomains. Recommended workshop length: half a day, 5–8 participants (architect, tech lead, product manager, domain expert, and possibly the CTO / VP of product).
-
List all capabilities / use cases.
Use business vocabulary, not IT jargon. Examples: “order goods,” “track a shipment,” “get a product recommendation,” “log in,” “receive a receipt by email,” “file a warranty claim.” Goal: 20–40 items for a mid-sized product. If you have more, aggregate. If fewer, be wary; you have probably missed something.
Brainstorming in front of an empty whiteboard is the worst way to arrive at the list. Community practice (the DDD Starter Modelling Process) places classification after Big Picture Event Storming: the capabilities are read off the event timeline the team has drawn. Where boundaries remain disputed, the Independent Service Heuristics from the authors of Team Topologies help. They are questions such as “could this part be run as a standalone SaaS product with its own price tag?”, which even a non-technical workshop participant understands.
-
For each item, answer the five-point test (section 02.03).
A 6-column table: capability + 5 questions. Each participant answers independently (anonymously, on Post-its or in Miro), then you take the median. Watch out for the hero syndrome. If a particular area's advocate on the team takes part in the vote, give their vote a lower weight. Otherwise the vote ratifies existing advocacy instead of testing it.
-
Group into subdomains.
Capabilities that share business vocabulary and classification belong to one subdomain. Example: “offer a discount,” “apply a coupon,” “calculate the final price” → the Pricing subdomain. An approximate number of subdomains, again a rule of thumb without support in a primary source: 8–15 for a mid-sized product, 20–40 for a large enterprise system. If you have 5, that is suspiciously few (Supporting subdomains typically hide inside Core); if 60, that is too many (you are typically not aggregating capabilities).
-
Decide sourcing for each subdomain.
Use the table from section 02.07. For Core, confirm BUILD; for Generic, compare 2–3 SaaS options (price, vendor stability, ACL complexity); for Supporting, decide BUILD vs. BUY. The output of this step is a list of selected vendors and the internal teams that get budget.
-
Write it into a Domain Vision Statement (one page) – who, what, why, when.
For each Core subdomain, create a one-page document (Markdown or Notion / Confluence). For Supporting, one sentence in the internal wiki is enough. For Generic, a note “we buy X from vendor Y, the contract runs until Z” is enough. This document is the only workshop output that survives. Without it, the classification gets lost.
The procedure above assumes that the boundaries are still taking shape. In an existing monolith, where pricing is spread across forty classes and three controllers, step 3 fails: capabilities cannot be grouped by code, because the code has no groups. So classify by business capabilities first, and only then look for where the cut runs through the existing code. Core Domain Charts have an Architecture Migration variant for this, which draws the current and target states into the chart. The extraction procedure is described in the chapter on migrating from CRUD.
Domain Vision Statement template
A Domain Vision Statement (DVS) is a short document that defines what, why, who, and when for a Core subdomain. It is based on Evans's pattern in the chapter “Distillation,” shortened in agile form to one page of Markdown:
1# Pricing – Core Domain2 3## What4Dynamic pricing with personalized promo codes.5Inputs: customer segment, purchase history, stock, time of day.6Output: the price for a specific customer in a specific context.7 8## Why core9Competitors use static pricing or run-of-the-mill discount codes.10Our dynamic pricing engine generates +18% margin compared to static pricing (A/B test 2026 Q1).11Without it, we are just another online store.12 13## Investment14Team: 3 senior PHP devs + 1 data scientist + a full-time product owner.15Stack: in-house engine in PHP 8.4 / Symfony 8, no SaaS in the core.16Persistence: PostgreSQL (rule store) + Redis (cache).17ML model: Python sidecar service, gRPC API.18 19## Bounded contexts20- Catalog BC (read model – indicative price)21- Checkout BC (write model – final price, validation, invariants)22- Recommendation BC (cross-context, reads Pricing events)23 24## Off-limits25No outsourcing. No low-code platforms.26No junior without code review from the tech lead.27No decision on pricing logic without the VP of product.28 29## KPI30- Margin (target +20% over baseline)31- Price latency < 50 ms p9932- Catalog vs. checkout price consistency < 0.1%33 34## Re-evaluation35Every 12 months – if the competition catches up, we move it to Supporting.
A DVS is a living document, and it changes with the strategy, the vendor, the team, or the KPIs. If nobody has updated it in half a year and the Core Domain still exists, something is wrong. Either nothing is happening in it, in which case it may not be Core, or nobody maintains the document, in which case nobody reads it either.
02.10 Summary#
Without a subdomain classification, there is no point in working on Bounded Contexts, aggregates, or Doctrine mapping. You are modeling blind, and the budget dissipates evenly across the unimportant parts of the application.
The main rules to remember:
- The Core Domain is rare, but not necessarily the only one – there is no numeric rule, and a company competing on several axes can have more than one Core subdomain. What does hold is that Core is inherently complex and changing; a simple subdomain gives only a short-term advantage. This is where most of the modeling effort, the senior team, and in-house IP go.
- Supporting subdomains are the majority – on the order of 50–60% of development capacity, the same unit as in section 02.04 (a rule of thumb, not measured data). Light DDD or Doctrine ORM CRUD, a mid-level team, and a willingness to reach for ready-made solutions where possible. Goal: work reliably with minimal maintenance. High complexity in Supporting is a signal to reclassify.
- Generic is bought by default – authentication, emails, payments, and full-text search. An in-house implementation is defensible only when the integration cost exceeds the implementation cost. A thin Anti-Corruption Layer protects our models from a foreign vocabulary.
- Mapping subdomains to Bounded Contexts is not automatically 1:1 – the ideal is 1:1, and N:1 is common for small Supporting and Generic subdomains. Splitting coherent functionality into several contexts pays off only for operational reasons (separate development cycles, independent scaling). A subdomain is a business boundary, a BC an implementation one; they are not interchangeable.
- Classification ages – it gets reassessed every 12–18 months. Generic can become Core (Stripe), Core can become Supporting (file synchronization), and Supporting can become Generic (helpdesk). A team without a current classification cannot prioritize.
Subdomain classification serves investment decisions, not an aesthetic split of the code. The chapter has served its purpose if it produced a list of your own product's subdomains, with a sourcing decision for each. If all that remains is the impression that “this is how one could categorize things,” go through it again with a concrete project in hand.
Frequently asked questions
What is the difference between a subdomain and a Bounded Context?
A subdomain is a business boundary, a piece of the problem that the organization handles as one chapter. It usually existed before the IT system did (“sales,” “logistics,” “human resources”). A Bounded Context is an implementation boundary: the place where one Ubiquitous Language and one consistent model apply, typically along with one team. A separate service or a module of a monolith? That is an operational decision. The relationship does not have to be 1:1: one subdomain can be split into several BCs, or several subdomains can live in one BC (typical for small Supporting and Generic subdomains). Details are in the Mapping subdomains to Bounded Contexts section.
Can I change a subdomain's classification during the product's lifetime?
Yes. Classification ages, and re-evaluation every 12–18 months is a necessary part of strategic DDD. Typical shifts: Generic becomes Core (online payments for Stripe in 2010), Core becomes Supporting (file synchronization for Dropbox after Google Drive and OneDrive arrived), and Supporting becomes Generic (helpdesk after Zendesk arrived). Reclassification has a practical consequence: a different investment, a different team, and a different sourcing strategy. Details are in the How subdomains evolve over time section.
How do I recognize that a subdomain is Generic?
A Generic subdomain is commoditized: the solution has existed for years, it is sold as SaaS, a library, or open source, and a market standard determines what it should look like. Typical examples besides authentication: generating PDF invoices (ready-made libraries and invoicing services) and sending transactional emails (SMTP is a standardized protocol, and the vendor handles deliverability). What separates it from Supporting is complexity: Generic is a complex but already solved problem that does not change, while Supporting tends to be simple. The default decision is to buy, plus a thin Anti-Corruption Layer at the boundary; an in-house implementation is defensible only when integration would cost more than writing it. Details are in the Three axes, not one section.
How many subdomains is a “normal” number?
As a rough guide, 8–15 subdomains for a mid-sized product and 20–40 for a large enterprise system. These are this book's rules of thumb, not measured data. If you have fewer than 8, Supporting subdomains are typically hiding inside Core; if you have more than 40, you are not aggregating capabilities enough and are working at too fine a granularity. Development capacity splits roughly into 20–30% Core, 50–60% Supporting, and 10–20% Generic. Five or more Core subdomains are not a mistake in themselves, because a company competing on several axes can have more. They do deserve a control question, though: how exactly does each of them differ in the market?
What if it turns out we have no Core Domain?
That is a legitimate result and often a signal that full DDD is not worth the cost. If, after the five-point test (section 02.03), not a single subdomain is left with 3+ YES answers, your product is probably a “better CRUD”: a combination of commoditized solutions (Generic) and internal administration (Supporting) without a real differentiator. In that case, a CRUD architecture with a service layer (Transaction Script) over Doctrine entities is the natural choice; an investment in full tactical DDD would not pay back. A detailed analysis is in the chapter When Not to Use DDD.
Does every Core subdomain need its own Bounded Context?
The goal is 1:1. Splitting coherent functionality into several contexts is more of a warning sign: the same change in requirements then hits both contexts and forces a simultaneous deployment. The legitimate reasons to split are operational: the need to separate the development cycles of components or to scale one part independently of the rest. An example from the online store: Pricing (Core) lives in both the Catalog BC and the Checkout BC, because listing and checkout have different performance requirements and deploy at different paces. Without such a reason, a subdomain is not split.
02.11 Further reading#
Sources on strategic DDD and subdomain classification:
- Domain Language – Eric Evans's official site, where you will find the DDD Reference (free), summarizing the strategic patterns, including Core Domain and Generic Subdomains.
- Implementing Domain-Driven Design – Vaughn Vernon; chapter 2, “Domains, Subdomains, and Bounded Contexts,” is the reference reading for this chapter.
- Learning Domain-Driven Design – Vlad Khononov (O'Reilly 2021); chapter 1, “Analyzing Business Domains,” is the most current account of subdomain classification.
- EventStorming – Alberto Brandolini, a workshop technique for identifying subdomains at scale (Big Picture Event Storming).
- Martin Fowler – Bounded Context – a short but apt definition of a BC that helps tell it apart from a subdomain.
- Core Domain Charts (DDD Crew) – open-source templates for visualizing subdomain classification, including a catalog of questions for both axes and the Architecture Migration variant.
- Core Domain Patterns – Nick Tune, a vocabulary of eight patterns (Decisive Core, Commoditised Core, Black Swan Core, Suspect Supporting, and others) for describing shifts over time.
- Revisiting the Basics of DDD – Vlad Khononov, a shorter precursor to the first chapter of Learning DDD: the three classification axes and the question of whether a subdomain could be sold as a standalone business.
- Patterns, Principles and Practices of DDD – Scott Millett and Nick Tune; chapter 3, “Focusing on the Core Domain,” and the heuristic “code for replacement rather than reuse” for Supporting subdomains.
- Architecture for Flow – Susanne Kaiser connects subdomain classification with Wardley Maps and Team Topologies.
- Independent Service Heuristics – a set of questions for finding subdomain boundaries, understandable even to non-technical workshop participants.