Context Map
MilkPlanning [D, ACL] <- [U] ClientOrders
andProductionPlanning [D, ACL] <- [U] ClientOrders
ClientOrders
sends a message toMilkPlanning
andProductionPlanning
to inform a new order was received.MilkPlanning
andProductionPlanning
are downstream core domains so it's necessary to insert an Anti-Corruption Layer between them andClientOrders
. Moreover,ClientOrders
is going to be a generic bounded context, as reported in the Core Domain Chart.MilkPlanning [D, ACL] <- [U] Restocking
MilkPlanning
asksRestocking
the remaining quantity of milk and informsRestocking
to place an order for the required amount of milk. In addition it asksRestocking
the quantity of milk used in the previous year.MilkPlanning
is a downstream core domain sinceRestocking
provides a service to it and the latter is going to be a generic bounded context, as reported in the Core Domain Chart. For all these reasonsMilkPlanning
has an Anti-Corruption Layer on its side.ClientOrders [D, CF] <- [U] Pricing
Pricing
computes forClientOrders
the price of each order line. AsPricing
is the service provider, it is upstream. Also, sinceClientOrders
andPricing
are tightly coupled, the former is Conformist.Production [D, CF] <- [U] ProductionPlanning
ProductionPlanning
providesProduction
with the production plan for the day. AsProductionPlanning
is the service provider concerningProduction
, they are respectively upstream and downstream. SinceProductionPlanning
andProduction
are tightly coupled, the latter is Conformist.Stocking [D, ACL] <- [U] ClientOrders
Stocking
receives a message fromClientOrders
notifying the removal from stock of certain products.Stocking
has an Anti-Corruption Layer, asClientOrders
is going to be a generic bounded context and it will be impossible to control the format of the messages.ProductionPlanning [D, ACL] <- [U] Stocking
ProductionPlannig
asksStocking
for the number of products missing from the stock. SinceProductionPlannig
is a downstream core bounded context, an Anti-Corruption Layer is required.Stocking [D, CF] <- [U] Production
Production
informsStocking
that a batch is ripening. SinceProduction
andStocking
are tightly coupled, the latter is Conformist.Restocking [D] <- [U, CF] Production
Production
informsRestocking
when some raw materials are consumed.Production
is an upstream Open-Host Service and must expose a published language as theRestocking
downstream bounded context is going to be generic and we will not be able to freely change its API.MilkPlanning [D, ACL] <- [U] Stocking
MilkPlanning
asksStocking
for the amount of products in stock. SinceMilkPlanning
is a downstream core bounded context, and Anti-Corruption Layer is required.
There is a Shared Kernel among the bounded contexts which contains the definitions for product, cheese type and ingredient. This choice was taken as the three aforementioned concepts are crucial for the cheese factory and a change in any of the definitions must be reflected in all bounded contexts handling these concepts. In fact, adding a new kind of product involves a series of important domain changes that must be reflected in the code of different bounded contexts: the production, ordering, labeling and stocking processes would need a rehaul to take into account the new kind of product. By sharing this information among different bounded contexts it is guaranteed that, whenever a change happens to any of these concepts, all the domains will maintain an up-to-date vision.