Markdown Editor

DDD Context Map Template

Map bounded contexts and their DDD relationships (ACL, OHS, conformist, shared kernel), team ties and evolution plan

Kiến trúc & Thiết kế hệ thốngChuẩnDomain-Driven Design context mapping patterns (Evans)contextmap
Mở trong editorTải .md

Cách dùng: Use it to expose integration and team problems across a domain before a re-org, migration or platform change. Draw the as-is map with honest upstream/downstream directions first. The main pitfall is recording only technology (REST, Kafka) instead of the model and team relationship.

Xem trước

Context Map: [Domain or product area]

Map of the bounded contexts in one domain and the relationships between them: who depends on whom, which Domain-Driven Design integration pattern governs each relationship, how the teams cooperate and how the map should evolve. Based on the context mapping patterns of Domain-Driven Design (Eric Evans) and common practice. Replace every [bracketed] value and every row marked Example. Worked examples use an online grocery retailer.

FieldValue
Domain / scope[Online grocery: ordering, fulfilment, payments]
Map type[As-is / To-be / Both]
Version[0.1]
Status[Draft / Agreed / Superseded]
Owner[@domain-architect]
Contributors[@team-leads]
Related documents[Bounded context canvases], [EventStorming summary], [ADRs]
Last updatedYYYY-MM-DD

1. Scope and purpose

[Scope statement. Example: This map covers the eight bounded contexts involved from basket to doorstep. It supports the decision to replace the legacy order management system and to split the Fulfilment team in two.]

2. Pattern reference

PatternAbbrev.Meaning in this map
PartnershipPTwo teams succeed or fail together and coordinate planning of shared features
Shared kernelSKTwo contexts share a small, explicitly agreed part of the model and code; changes need both teams' consent
Customer-supplierC/SUpstream supplier plans with the downstream customer's needs in mind; the customer has a say in priorities
ConformistCFDownstream adopts the upstream model as is, because it has no influence over it
Anticorruption layerACLDownstream translates the upstream model into its own, protecting its language
Open host serviceOHSUpstream offers a well-defined protocol or API that serves many consumers
Published languagePLA documented, shared exchange format (schema, standard) used across the relationship
Separate waysSWNo integration; each context solves its need independently
Big ball of mudBBoMA part of the system with mixed models and no clear boundary; contain it rather than spread it

3. Bounded contexts

IDContextClassificationOwning teamMain responsibilityCanvas
BC-01Example: CatalogueSupportingTeam RangeProducts, prices shown to shoppers, availability flags[Link]
BC-02Example: Basket and CheckoutCoreTeam CheckoutBasket rules, substitutions preferences, order placement[Link]
BC-03Example: Slot BookingCoreTeam SlotsDelivery slot offers and capacity[Link]
BC-04Example: FulfilmentCoreTeam FulfilmentPicking, substitution, van loading[Link]
BC-05Example: PaymentsGenericTeam PaymentsAuthorisation, capture, refunds via payment provider[Link]
BC-06Example: Legacy OMSBig ball of mudTeam PlatformOrder state, invoices, customer service screensn/a
BC-07Example: Payment providerExternalVendorCard processingn/a
[BC-NN][Context][Core / Supporting / Generic / External][Team][Responsibility][Link]

4. Context map diagram

The diagram below shows the as-is relationships; arrows point from upstream to downstream.

5. Relationship register

IDUpstreamDownstreamUpstream patternDownstream patternMechanismPain or risk
REL-01Example: CatalogueBasket and CheckoutOHS + PLConformistREST API, JSON schema product.v2Price changes during checkout cause basket recalculation
REL-02Example: Slot BookingBasket and CheckoutPartnershipPartnershipEvents SlotReserved, SlotReleasedJoint releases needed for slot changes
REL-03Example: Basket and CheckoutFulfilmentSupplierCustomerEvent OrderPlaced on message brokerFulfilment needs fields that are not yet in the event
REL-04Example: Legacy OMSFulfilmentNone (no influence)ACLNightly database export, translated by adapterData is up to 24 hours stale
REL-05Example: Payment providerPaymentsOHS + PLACLProvider SDK and webhooksProvider model leaks into refund logic
REL-06Example: FulfilmentBasket and CheckoutShared kernelShared kernelShared library substitution-rulesVersion drift between teams
[REL-NN][Context][Context][Pattern][Pattern][Mechanism][Pain]

6. Team relationships

RelationshipTeamsHow they cooperate todayHealthy?Action
REL-02Example: Team Slots and Team CheckoutJoint planning every two weeks, shared Slack channelYesKeep
REL-03Example: Team Checkout and Team FulfilmentFulfilment raises tickets; prioritised quarterlyNoMove to monthly customer review of the OrderPlaced contract
REL-04Example: Team Platform and Team FulfilmentNo regular contactNoName an OMS contact; plan strangler migration
[REL-NN][Teams][Cooperation][Yes / No / Partly][Action]

7. Integration details

RelationshipContractContract ownerTranslation ownerVersioningSLA / freshness
REL-01Example: catalogue-api OpenAPITeam RangeNone (conformist)URI major version, 6-month deprecationp95 120 ms, 99.9%
REL-03Example: OrderPlaced event schema v3Team CheckoutTeam FulfilmentSchema registry, backward compatibleDelivered within 5 s
REL-04Example: OMS export fileTeam PlatformTeam Fulfilment (ACL)NoneDaily at 02:00
[REL-NN][Contract][Team][Team][Policy][SLA]

8. Evolution plan

The target map changes three relationships.

IDChangeFromToReasonDecision / ticketTarget date
EV-01Example: Replace OMS export with eventsBBoM + ACLOHS + PL from new Order contextStale data causes missed substitutionsADR-031YYYY-MM-DD
EV-02Example: Dissolve shared kernel for substitution rulesShared kernelCustomer-supplier, Fulfilment upstreamTeams release on different cadencesADR-034YYYY-MM-DD
EV-03Example: Add ACL in Basket for catalogue modelConformistACLCatalogue model change broke checkout twice[Ticket]YYYY-MM-DD
[EV-NN][Change][Pattern][Pattern][Reason][Link]YYYY-MM-DD

The to-be diagram shows the end state after EV-01 to EV-03.

9. Risks and open questions

IDRisk or questionOwnerMitigation or next step
R-01Example: New Order context needs OMS invoice logic that nobody fully understands@platform-leadEventStorming session on invoicing before EV-01 starts
R-02Example: Payments vendor change would require a new ACL@payments-leadKeep provider types out of the Payments domain model
[R-NN][Risk][@owner][Mitigation]

Standard and licence note

Based on the strategic design and context mapping patterns of Domain-Driven Design (Eric Evans, Domain-Driven Design, 2003, and his later Domain-Driven Design Reference, which adds the partnership pattern). The pattern names are industry terms; all text, tables and examples here are original to this collection. Template licence: MIT.

Template liên quan