Consistency
So far in this chapter we’ve looked at ways to enforce the integrity of the data in the domain, so now let’s finish up by taking a look at the related concept of consistency.
We saw some examples of consistency requirements at the beginning of the chapter:
-
The total amount for an order should be the sum of the individual lines. If the total differs, the data is inconsistent.
-
When an order is placed, a corresponding invoice must be created. If the order exists but the invoice doesn’t, the data is inconsistent.
-
If a discount voucher code is used with an order, the voucher code must be marked as used so it can’t be used again. If the order references that voucher but the voucher is not marked as used, the data is inconsistent.
As described ...
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