One hexagon per bounded context?
When working with Hexagonal Architecture and multiple bounded contexts, our reflex is to create a separate “hexagon” for each bounded context. The result would look something like Figure 13.1.
Figure 13.1 – If each bounded context is implemented as its own hexagon, we need an outgoing port, an adapter, and an incoming port for each line of communication between bounded contexts
Each bounded context lives in its own hexagon, providing input ports to interact with it and using output ports to interact with the outside world.
Ideally, the bounded contexts don’t need to talk to each other at all, so we don’t have any dependencies between the two. In the real world, however, this is rarely the case. Let’s assume that the bounded context on the left needs to call some functionality of the bounded context on the right.
If we use the architecture elements that Hexagonal Architecture...