Bounded Context Canvas

https://github.com/ddd-crew/bounded-context-canvas

The Bounded Context Canvas is a collaborative tool for designing and documenting the design of a single bounded context.

It identifies 3 types of inbound and outbound communication objects: Queries, Commands and Events

It also includes the Ubiquitous Language for the Bounded Context: Aggregates, Policies and Business Decisions

Bounded Context Canvas

ZDL can map each of those elements into a developer friendly and machine-readable format.

apis {
asyncapi(provider) MyEventsApi {
uri "src/main/resources/asyncapi.yml"
}
openapi(provider) MyRestApi {
uri "src/main/resources/openapi.yml"
}
asyncapi(client) ThirdPartyEventsApi {
uri "https://.../asyncapi.yml"
}
openapi(client) ThirdPartyRestApi {
uri "https://.../openapi.yml"
}
}
// ============
@aggregate
entity MyEntity {}
input MyEntityInput {}
output MyEntityReadModel {}
policies (MyEntity) {
policy001 "Describe here the content of this business rule"
}
service MyService for (MyEntity) {
// inbound async command
@policies(policy001)
@asyncapi({api: ThirdPartyRestApi, operationId: "createMyEntity"})
createMyEntity(MyEntityInput) MyEntity withEvents ThirdPartyAsyncRequest MyEntityUpdatedEvent // outbound events
// inbound sync command
@rest({api: MyRestApi, operationId: "showMyEntityById"})
@uses({api: ThirdPartyRestApi, operationId: "fetchRelatedData"}) // outbound query
synchMyEntityWithThirdPartyData(id) MyEntityReadModel
// inbound query
@rest({api: MyRestApi, operationId: "listMyEntities"})
listMyEntities() MyEntityReadModel[]
}
@asyncapi({api: MyEventsApi, operationId: "onMyEntity"}) // outbound event
event MyEntityUpdatedEvent {}
@asyncapi({api: ThirdPartyEventsApi, operationId: "thirdPartyRequestsChannel"}) // outbound command
event ThirdPartyAsyncRequest {}