Markdown Editor

Bounded Context Canvas Template (DDD Crew)

Design one DDD bounded context: purpose, strategic classification, roles, inbound/outbound messages, language, rules, metrics

Kiến trúc & Thiết kế hệ thốngChuẩnBounded Context Canvas V5 (DDD Crew); Domain-Driven Design (Evans)CC BY-SA 4.0boundedcontextcanvas
Mở trong editorTải .md

Cách dùng: Use it when designing or reviewing a single bounded context, ideally in a workshop. Agree the name and purpose first, then fill communication and business decisions. The main pitfall is guessing: record unknowns as open questions instead.

Xem trước

Bounded Context Canvas: [Context name]

Design record for a single bounded context: its name, purpose, strategic classification, domain roles, inbound and outbound communication, ubiquitous language, business decisions, assumptions, verification metrics and open questions. The sections follow the Bounded Context Canvas V5 by the DDD Crew (CC BY-SA 4.0), which builds on Domain-Driven Design as described by Eric Evans. Replace every [bracketed] value and every row marked Example. Worked examples use a parcel delivery company's "Shipment Scheduling" context.

FieldValue
Context name[Shipment Scheduling]
Canvas version[0.1]
Status[Exploring / Agreed / Implemented / Under review]
Owning team[@team-delivery-planning]
Domain / subdomain[Last-mile delivery / Scheduling]
Workshop dateYYYY-MM-DD
Facilitator[@facilitator]
Related documents[Context map link], [EventStorming summary link], [ADR links]
Last updatedYYYY-MM-DD

1. Name

Name: [Shipment Scheduling]

Alternative names considered and rejected:

Candidate nameWhy rejected
Example: Delivery ServiceTechnical name; says nothing about the responsibility
Example: RoutingRoute optimisation is a separate, generic capability bought from a vendor
[Candidate][Reason]

2. Purpose

[Purpose statement. Example: Shipment Scheduling decides when each parcel will be delivered and commits that promise to the customer. It turns accepted shipments into delivery slots that respect depot capacity, driver shifts and customer preferences, and it re-plans when reality changes. Customers, merchants and depot planners rely on it for a delivery date they can trust.]

Key actors who get value: [Recipients, merchants, depot planners]

3. Strategic classification

DimensionOptionsChoiceRationale
Domain importanceCore / Supporting / GenericExample: CoreReliable delivery promises are the main reason merchants choose us over competitors
Business model roleRevenue generator / Engagement creator / Compliance enforcerExample: Revenue generatorPremium "named-day" delivery is sold per parcel
EvolutionGenesis / Custom built / Product / CommodityExample: Custom builtCompetitors build their own; no product fits depot-level capacity rules

Implication for investment: [Example: Build in-house with the most experienced team; buy route optimisation (generic) as a product.]

4. Domain roles

RoleApplies?Evidence
Execution contextExample: YesRuns the scheduling workflow for each accepted shipment
Specification contextExample: PartlyDefines slot rules that Depot Operations follows
Analysis contextExample: NoCapacity forecasting lives in Network Planning
Gateway contextExample: NoCarrier integrations live in Partner Gateway
[Role][Yes / No / Partly][Evidence]

5. Inbound communication

IDCollaboratorCollaborator typeMessageMessage typeRelationship typeNotes
IN-01Example: Shipment IntakeBounded contextShipmentAcceptedEventCustomer-supplier (we are downstream)Triggers initial scheduling
IN-02Example: Recipient web appFrontendChooseDeliveryDayCommandOwned UIRecipient picks one of three offered days
IN-03Example: Merchant portalFrontendGetPromisedDateQueryOpen host servicep95 latency 150 ms
IN-04Example: Depot OperationsBounded contextDepotCapacityChangedEventPartnershipSent when a depot loses vans or staff
[IN-NN][Collaborator][Context / Frontend / External system / User][Message][Command / Query / Event][Relationship][Notes]

Use case swimlane (optional): describe the main flow as message in -> decisions made -> message out. Example: ShipmentAccepted -> choose earliest slot with capacity and promise rules -> DeliveryPromised.

6. Outbound communication

IDCollaboratorCollaborator typeMessageMessage typeRelationship typeNotes
OUT-01Example: NotificationsBounded contextDeliveryPromisedEventPublished languageRecipient receives SMS and email
OUT-02Example: Route Optimisation (vendor)External systemOptimiseRoutesCommandAnticorruption layerNightly batch per depot
OUT-03Example: Depot OperationsBounded contextDeliveryRescheduledEventPartnershipMoves parcel to another van load
OUT-04Example: BillingBounded contextNamedDayServiceDeliveredEventCustomer-supplier (we are upstream)Charges the premium fee
[OUT-NN][Collaborator][Type][Message][Type][Relationship][Notes]

7. Ubiquitous language

TermMeaning in this context
Example: Delivery promiseThe date and time window the customer was told, which we commit to meet
Example: SlotA depot's capacity for one day and one time window, measured in parcel stops
Example: RescheduleMoving a promise to a new slot, with the recipient informed before the original window starts
Example: Named dayA paid service where the recipient chooses the day; failure triggers a refund
[Term][Meaning]

8. Business decisions

IDRule or policySourceExample
BR-01Example: A slot may be booked up to 95% of its capacity; the last 5% is reserved for rescheduled parcelsHead of OperationsDepot with 400 stops accepts 380 new promises
BR-02Example: A promise may be rescheduled at most twice before escalation to a plannerCustomer service policyThird reschedule creates a planner task
BR-03Example: Named-day promises are never moved by automatic reschedulingCommercial termsCapacity loss moves standard parcels first
BR-04Example: Promises are offered only for days when the recipient's address is serviceableNetwork rulesIsland postcodes receive Tuesday and Friday only
[BR-NN][Rule][Owner or document][Concrete example]

9. Assumptions

IDAssumptionImpact if wrongHow we will validateStatus
AS-01Example: Depot capacity changes at most a few times a dayEvent volume and recalculation cost rise sharplyCount DepotCapacityChanged for four weeksOpen
AS-02Example: Route optimisation remains a generic product we can buyWe would need a team to build itVendor review in Q3Open
AS-03Example: Recipients accept a promise window of two hoursNeed finer slots and a new capacity modelSurvey plus A/B test on 5% of trafficValidated YYYY-MM-DD
[AS-NN][Assumption][Impact][Validation][Open / Validated / Invalidated]

10. Verification metrics

MetricSourceTargetCurrentSignal if breached
Example: Share of changes that also touch another context's codeVersion control< 10% of merged pull requests[Value]Boundary may be in the wrong place
Example: Synchronous calls to other contexts per scheduling commandTracing<= 2[Value]Context lacks data it should own
Example: Releases blocked by another teamIssue tracker0 per month[Value]Coupling at team level
Example: Promises kept (delivered in promised window)Production>= 97%[Value]Business decisions or model need review
[Metric][Source][Target][Value][Signal]

11. Open questions

IDQuestionOwnerNeeded byAnswer
OQ-01Example: Should rescheduling for weather events be decided here or in Network Planning?@domain-expertYYYY-MM-DD[Answer when known]
OQ-02Example: Do merchants need to cancel a promise, or only the recipient?@product-ownerYYYY-MM-DD[Answer]
[OQ-NN][Question][@owner]YYYY-MM-DD[Answer]

12. Design review checklist

  • The purpose is written in business language and fits in four sentences.
  • Message names are coherent with each other and with the purpose.
  • Each message type is the right one (a command that should be an event, or the reverse, is flagged).
  • The interface is not too big: [N] distinct message types in, [N] out.
  • No message exposes internal model details that collaborators should not depend on.
  • No message obviously belongs to another context.
  • Every relationship type matches the context map.
  • Every assumption has a validation plan and every open question has an owner.

Standard and licence note

Structure adapted from the Bounded Context Canvas (V5) by the DDD Crew (Nick Tune and contributors), https://github.com/ddd-crew/bounded-context-canvas. The repository's licence file states Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/); its README shows a CC BY 4.0 badge, so this adaptation follows the stricter of the two. The adapted structure in this template is shared under CC BY-SA 4.0. Concepts of bounded contexts, ubiquitous language and context relationships come from Domain-Driven Design by Eric Evans. All explanatory text and examples are original to this collection.

Template liên quan