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

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 ...

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