O'Reilly logo

Domain Modeling Made Functional by Scott Wlaschin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Communicating Between Bounded Contexts

How do bounded contexts communicate with each other? For example, when the order-taking context has finished processing the order, how does it tell the shipping context to actually ship it? As we’ve seen earlier, the answer is to use events. For example, the implementation might look like this:

  • The Place-Order workflow in the order-taking context emits an OrderPlaced event.
  • The OrderPlaced event is put on a queue or otherwise published.
  • The shipping context listens for OrderPlaced events.
  • When an event is received, a ShipOrder command is created.
  • The ShipOrder command initiates the Ship-Order workflow.
  • When the Ship-Order workflow finishes successfully, it emits an OrderShipped event.

Here’s a diagram for this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required