Subdomain¶
A Subdomain is a strategic classification of part of the Domain. It groups Bounded Contexts by their value to the business, so the model captures not only what the system does but also where investment matters.
Subdomains are orthogonal to Bounded Contexts, not a hierarchy on top of them. A Bounded Context can exist without a Subdomain, and Subdomains classify Bounded Contexts after the fact.
Core, Supporting, and Generic¶
Domain-Driven Design distinguishes three kinds. Core Subdomains carry the strategic value of the business and deserve the most modeling care. Supporting Subdomains are necessary but not differentiating – specific enough to build in-house, but not strategic. Generic Subdomains are commodity – authentication, payment, geocoding – and are usually solved by a third-party product.
ESDM lets you classify each Subdomain so the distinction is visible in the model rather than implicit in someone's head. The classification doesn't change how the linter behaves, but it does change how you read the model later.
A Minimal Example¶
apiVersion: schema.esdm.io/core/v1
kind: subdomain
name: round-play
scope:
domain: golf-club-management
type: core
boundedContexts:
- round-play
description: The ongoing play of golf rounds and everything tied to that flow.
The scope.domain reference must resolve. Each name under boundedContexts must match a Bounded Context document.