January 2018
Beginner to intermediate
312 pages
7h 22m
English
In this chapter, we learned how to ensure that data inside our domain could be trusted.
We saw that the combination of “smart constructors” for simple types, and “making illegal states unrepresentable” for more complex types, meant that we could enforce many kinds of integrity rules using the type system itself, leading to more self-documenting code and less need for unit tests.
We also looked at maintaining consistent data within one bounded context and between bounded contexts, concluding that, unless you are working within a single aggregate, you should design for eventual consistency rather that immediate consistency.
In the next chapter, we’ll put all this into practice as we model our order-placing workflow.
Read now
Unlock full access