Chapter 11Serialization
In the examples in this book, we have designed our workflows as functions with inputs and outputs, where the inputs come from Commands and the outputs are Events. But where do these commands come from? And where do the events go? They come from, or go to, some infrastructure that lives outside our bounded context—a message queue, a web request, and so on.
This infrastructure has no understanding of our particular domain, and therefore we must convert types in our domain model into something that the infrastructure does understand, such as JSON, XML, or a binary format like protobuf.[30]
We’ll also need some way of keeping track of the internal state needed by a workflow, such as the current state of an Order. Again, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access