Looking for general principles for design patterns with respect to storing and converting known values ββ(i.e. meters to feet). Being googling was unlucky, so I must have something missing.
Assuming many fields with different UOMs in the same table are the best? Currently, many of the fields are implied, and we are looking at standardizing this. We want to give users the freedom to enter their UOM, and others to view it in their preferred UOM.
Do I have to store the "entered value" and convert it to some common primitive (the user enters the legs, I convert to counters and save this)? Should I store this entered stop value as an audit backup?
I am not the only consumer of any database table, is it better that in other applications the value is always indicated to the value + UOM and the raw user value.
Are there serious consequences for the conversion that I may lose. Meters> legs> meters should be reliable enough for conversion for a business application (conversions can be up to the 17th decimal place, but the displayed and entered values ββare limited to 2-4 decimal places)
Any other thoughts or links to point me in the right direction so that I don't invent a solution to a known problem?
Please note that I do not expect some grandiose solution with operator overloading, but more than that which will work in a practical application that the average Joe developer can support.
java design c # design-patterns design-principles
user610254
source share