Single Value Objects: where DDD and Functional Programming Share Forces
summary
Describes using Single Value Objects (types that encapsulate a single domain value plus validation, normalization and units) to eliminate primitive obsession in DDD and functional code. Gives concrete examples like money (amount + currency), percentages (parsing/rounding), and date-only types, and demonstrates an open-source .NET library, QWave, which provides a NuGet package and code generator for factories and custom JSON/XML serialization. Covers real-world pitfalls (the 1998 NASA 3% unit mismatch) and shows IBAN parsing, equality rules, and serialization conventions used in production systems.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:10Single Value Objects
- 4:22Code clarity benefits
- 7:37Normalization and formatting
- 13:43Domain logic and operations
- 17:40Serialization and communication
- 20:42Serialization challenges
- 23:57Equality and conventions
- 25:26Q wave library reuse
- 27:00When to avoid SVO
related talks
11mThe Value of Objects -
37mDomain modelling in object-oriented and functional programming, based on C# and F#
32mUndervalued: The Most Useful Design Pattern
51mDomain Modeling Made Functional
05mFunctional Programming without the Functions
34mLife After Business Objects - Confessions of an OOP Veteran
42mHigh-Speed DDD (revisited)
45mBeyond design patterns and principles - writing good OO code
