Domain Modeling with Algebraic Data Types
Inspired by this talk and this article.
How can we diminish primitive obsession when modeling domain classes?
How can we make our domain classes better communicate what are their boundaries? E.g.: Instead of validating and documenting that a phone number must have only 9 digits, why not making a Digits9
that will represent exactly that instead?
"Make illegal states unrepresentable." - Yaron Minsky