3 ms·
I agree completely about the standard units - I was able to get that right in the production code fortunately. The biggest gain I can see from moving away from
by swanson 14y ago
I agree completely about the standard units - I was able to get that right in the production code fortunately. The biggest gain I can see from moving away from the primitive is from a developer's point of view.
By leaving it as an int, I (and the rest of the team) have to know that the value is not suitable for display. Moving to a value object is not the only way to solve this issue; I could have introduced a `CarbsView` that handled the conversions and it would have solved the issue as well. A lot of this kind of stuff just comes down to personal (and team) preferences for designing your app.
- jdlshore 14y agoYou might be interested in Ward Cunningham's "Whole Value" pattern [1] which is part of his awesome CHECKS pattern language [2]: [1] http://c2.com/ppr/checks.html#1 http://c2.com/ppr/checks.html#1 [2] http://c2.com/ppr/checks.html http://c2.com/ppr/checks.html