Skip to main content
Version: Next

Domain-driven design

Mark subdomain types and bounded contexts, and see the context map they make.

Subdomain types and bounded contexts​

Kanoniq speaks domain-driven design's strategic terms. A domain is what DDD calls a subdomain, a part of the problem space; the whole problem space is the ecosystem's function side. The application side is DDD's solution space.

A domain may state its subdomain type: core, where the business competes; supporting, specific to the business but not what it competes on; or generic, a solved problem every business has. A sub-domain stating none takes its nearest typed parent's, and an Enabler Domain and everything in it are generic. Two lints check DDD's advice to build the core and buy the generic: a core domain realized only by saas or cots software (KQ112), and a generic one, Enabler Domains aside, realized by custom-built software (KQ113).

A bounded context is the boundary inside which one model, and the language naming it, holds. You mark it with bounded-context on a domain, a platform, a monolith, a module or a component, at whatever level the boundary falls; Kanoniq never guesses one. A component is in the context marked on it or on the module, monolith or platform around it, or on a domain at or above its primary domain. It is in at most one: contexts don't nest (KQ095). A component in no context is simply unmapped.

A context marked big-ball-of-mud as well is one whose model has no consistent boundaries inside it: a legacy system, often a vendor's, around which the boundary is drawn so the mess stays inside.

The context map​

Kanoniq reads which contexts depend on which from what the model already says, so the map never goes stale. Two contexts are joined wherever something crosses between them, and each crossing says which is upstream:

What crossesUpstreamDownstream
A call, in-process includedThe context of the component the interface belongs toThe caller's
A message through a channel: an event, or nothing saidThe sender'sThe receiver's
A command or a query through a channelThe receiver's, which handles itThe sender's
A copy of data whose authoritative entity is in another contextThe context holding the authoritative entityThe copy's

Components in no context are gathered at one end, Unmapped. Crossings both ways make two lines, each remembering every call, message and copy it comes from.

What the crossings cannot say is stated where it holds:

  • An open host service (OHS) and a published language (PL) are marks on the upstream's API or channel, open-host and published-language. A line reads them where every crossing of it goes through a marked one.
  • An anticorruption layer (ACL) is read from an integration component at the downstream end, which translates, or stated with acl on the connection where the downstream component translates itself. A line reads it where every crossing goes through one.
  • Team relationships are lines in a context's block: conformist (conforms-to) and customer and supplier (customer-of) in the downstream context, partnership, shared kernel and separate ways once in either. A relationship the crossings contradict is an error: see Context map.

DDD's advice on the map is policy, not validity: a core context conforming to another's model, a core context or any context taking from bought software or a Big Ball of Mud with no anticorruption layer, a copy of another context's data with no call, message or sync between the two, a line with no pattern stated. Each is in a preset (see The baselines).

The layered view draws a Domain's subdomain type and each mark on its boxes, and with its contexts switch on, each context as a boundary and every line crossing one (Layered view). The context map view draws an Ecosystem's contexts as boxes and the lines between them, upstream above downstream, with each pattern written at its end. The marks are read and checked, and the information pane shows them when you select an element (Selecting and moving around).

Relationships between contexts​

A bounded context states how it relates to another, in domain-driven design's terms, with a line in the block of the element marked bounded-context:

domain ordering "Ordering" core bounded-context { function place-order "Place order" conforms-to identity-access customer-of catalog partnership fulfillment } platform ordering-platform "Ordering platform" { component order-service "Order service" : backend order-service realizes ordering order-service -> services/identity-service/api over http order-service -> services/catalog-service/api over http order-service -> services/fulfillment-service/api over http }
LineMeansWritten in
conforms-to <context>Conformist: this context adopts the other's model as it isThe downstream context
customer-of <context>Customer and supplier: the other context plans for this one's needsThe downstream context
partnership <context>Partnership: the two teams succeed or fail togetherEither context, once
shared-kernel <context>Shared kernel: a part of the model both share and change only togetherEither context, once
separate-ways <context>Separate ways: deliberately no integrationEither context, once
  • Name the other context by the element marked bounded-context, its Code where it sits beside this one, its path otherwise: the domain, platform, monolith, module or component, not one of its members (KQ210).
  • Which way the integration runs is not written. Kanoniq reads it from the calls, channels and copies of data between the two, and reports a line they contradict: conforms-to toward a context downstream of this one (KQ204), a relationship with nothing crossing (KQ207), separate-ways with something crossing (KQ208). The rest of the checks are under Context map.
  • A line takes no as and no #assumed. Remove one in a later plateau with -conforms-to identity.

Through an anticorruption layer​

acl, after grant and before carries, says a connection into another bounded context goes through an anticorruption layer: the component at your end translates what it takes, rather than adopting the other context's model.

order-service -> payments/api over http acl

Where the component at the receiving end is an integration component, it is the translator already, so write nothing: acl there is an error (KQ212). In a -> b over events/orders acl, both connections are marked. A - line takes no acl (KB073); to add or drop it in a later plateau, remove the connection and write it again.

Reference​

The element types, relationships and kinds of this area, each with what it means.

Relationships

RelationshipWhat it says
Context RelationshipA Context Relationship states how two bounded contexts relate, in DDD's terms: conformist, customer and supplier, partnership, shared kernel or separate ways. The downstream states the first two; a symmetric one is stated once, in either context.

Subdomain type: A Domain's subdomain type, in DDD's terms: what the Domain is to the business, and so whether its software is built or bought.

ValueMeans
coreWhere the business competes, worth the best people and custom-built software.
supportingSpecific to the business but not what it competes on; built, often more simply, or outsourced.
genericA solved problem every business has, bought or taken off the shelf.

Context relationship kind: How two bounded contexts relate, in DDD's terms: stated by the downstream context, or once for a symmetric relationship.

ValueMeans
conforms-toConformist: the context holding it adopts the other's model as it is.
customer-ofCustomer and supplier: the other context, upstream, plans for the needs of the one holding it.
partnershipPartnership: two teams that succeed or fail together.
shared-kernelShared kernel: a part of the model both contexts share and change only together.
separate-waysSeparate ways: deliberately no integration between the two contexts.

© 2026 Extenza Works. All rights reserved.