The Integrity of Simple Values
Domain Modeling Made Functional — by Scott Wlaschin (57 / 125)
👈 Chapter 6 Integrity and Consistency in the Domain | TOC | Units of Measure 👉
In the earlier discussion on modeling simple values, we saw that they should not be represented by string or int but by domain-focused types such as WidgetCode or UnitQuantity.
But we shouldn’t stop there, because it’s very rare to have an unbounded integer or string in a real-world domain. Almost always, these values are constrained in some…