Hi Isomorphic,
I've been storing kilometer-distance data as number in the DB so far.
Now the system should also be able to support miles.
I think the only good solution is to normalize the data to kilometers and keep storing it this way. Do you agree?
The big question then is how/where to do the normalizing (e.g. 10->16 when storing, 16->10 when fetching).
I have many fields that store distances and if possible the change should be as little as possible. I'll have the setting if the user is using km or mi available everywhere via a static method in the clientside and in the session on the serverside.
My gut feeling says: "Use RequestTransformer and ResponseTransformer" clientside to take action if the user is using mi. (I recently started using them, therefore this might be an instance of "every problem looks like a nail if the tool you like the most is a hammer")
Or would you do something on the FormItem / ListGridField level? If so, what?
Thank you & Best regards
Blama
I've been storing kilometer-distance data as number in the DB so far.
Now the system should also be able to support miles.
I think the only good solution is to normalize the data to kilometers and keep storing it this way. Do you agree?
The big question then is how/where to do the normalizing (e.g. 10->16 when storing, 16->10 when fetching).
I have many fields that store distances and if possible the change should be as little as possible. I'll have the setting if the user is using km or mi available everywhere via a static method in the clientside and in the session on the serverside.
My gut feeling says: "Use RequestTransformer and ResponseTransformer" clientside to take action if the user is using mi. (I recently started using them, therefore this might be an instance of "every problem looks like a nail if the tool you like the most is a hammer")
Or would you do something on the FormItem / ListGridField level? If so, what?
Thank you & Best regards
Blama
Comment