I don't quite get how you want to prevent "accidental bugs" by just introducing value objects. Another module/API or another developer could still pass the wrong primitive values (from a different unit of measure) to create the object. The naming is better and more obvious of course.
Primitives vs Value Objects - Units of Measurement
I don't quite get how you want to prevent "accidental bugs" by just introducing value objects. Another module/API or another developer could still pass the wrong primitive values (from a different unit of measure) to create the object. The naming is better and more obvious of course.