

What do product and sum types have to do with data modeling?
Nov 14, 2019
Dive into the world of data modeling with a focus on product and sum types. Discover how these types play a crucial role in simplifying complex domain representations. Learn about the potential pitfalls of improper type representation and how it can complicate software development. The discussion emphasizes the elegance of clear models and the effectiveness of these concepts in ensuring all cases are accurately represented. It's all about making modeling targeted and straightforward!
AI Snips
Chapters
Transcript
Episode notes
Matching Model to Domain
- Having too many or too few cases in your domain model adds complexity.
- Strive for a perfect fit between your model and the real-world domain to reduce this complexity.
Sensor Reading Example
- Overloading a single value, like 0 in a sensor reading, can lead to ambiguity and conditional logic.
- This illustrates the problems of a mismatched model.
Stripe/PayPal IDs
- Storing Stripe and PayPal IDs in the same field with regex checks created unnecessary complexity.
- Switching to a sum type simplified the system.