0
votes

I am wondering if this is a DDD Anti Pattern. I have two Bounded Contexts in my eCommerce application: Inventory and Sales Order. The Sales Order context needs available inventory levels from the Inventory context before it can book orders. Once a Sales Order is placed, it needs to let the Inventory Conext know so that inventory is reserved/allocated for that inventory item. This results in 2-way communication. In one case, the Inventory is Upstream, and in the second case, it's Downstream.

2

2 Answers

0
votes

Two-way communication is not an anti-pattern. If you imagine a situation that you see the domains as actors and work with each other, you will see nothing special.

0
votes

The issue with modularisation is that you need both low coupling and high cohesion. The two-way communication indicates coupling so if that happens a lot between your bounded contexts you might want to rethink your partitioning. But a system needs communication between the parts, so it is common and not an anti-pattern.