Context Map
MilkPlanning [D, ACL] <- [U] ClientOrdersandProductionPlanning [D, ACL] <- [U] ClientOrders
ClientOrderssends a message toMilkPlanningandProductionPlanningto inform a new order was received.MilkPlanningandProductionPlanningare downstream core domains so it's necessary to insert an Anti-Corruption Layer between them andClientOrders. Moreover,ClientOrdersis going to be a generic bounded context, as reported in the Core Domain Chart.MilkPlanning [D, ACL] <- [U] Restocking
MilkPlanningasksRestockingthe remaining quantity of milk and informsRestockingto place an order for the required amount of milk. In addition it asksRestockingthe quantity of milk used in the previous year.MilkPlanningis a downstream core domain sinceRestockingprovides 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 reasonsMilkPlanninghas an Anti-Corruption Layer on its side.ClientOrders [D, CF] <- [U] Pricing
Pricingcomputes forClientOrdersthe price of each order line. AsPricingis the service provider, it is upstream. Also, sinceClientOrdersandPricingare tightly coupled, the former is Conformist.Production [D, CF] <- [U] ProductionPlanning
ProductionPlanningprovidesProductionwith the production plan for the day. AsProductionPlanningis the service provider concerningProduction, they are respectively upstream and downstream. SinceProductionPlanningandProductionare tightly coupled, the latter is Conformist.Stocking [D, ACL] <- [U] ClientOrders
Stockingreceives a message fromClientOrdersnotifying the removal from stock of certain products.Stockinghas an Anti-Corruption Layer, asClientOrdersis going to be a generic bounded context and it will be impossible to control the format of the messages.ProductionPlanning [D, ACL] <- [U] Stocking
ProductionPlannigasksStockingfor the number of products missing from the stock. SinceProductionPlannigis a downstream core bounded context, an Anti-Corruption Layer is required.Stocking [D, CF] <- [U] Production
ProductioninformsStockingthat a batch is ripening. SinceProductionandStockingare tightly coupled, the latter is Conformist.Restocking [D] <- [U, CF] Production
ProductioninformsRestockingwhen some raw materials are consumed.Productionis an upstream Open-Host Service and must expose a published language as theRestockingdownstream bounded context is going to be generic and we will not be able to freely change its API.MilkPlanning [D, ACL] <- [U] Stocking
MilkPlanningasksStockingfor the amount of products in stock. SinceMilkPlanningis 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.