Mar 9th, 2009, 04:41 PM
How to best mapping for List of Value (Select)
Which is best strategy to map service table used in html select component?
- reference to Object
I'm going to explein:
My root object is Customer
is has some property the user can choose using a html select component,
the only relevant of theese properties is its LABEL.
some example could be:
- service type (possible values: Gold; Silver; Platinum)
- company type (possible values: ltd, simple, private, other)
When the user choose theese options the the Customer will be saved.
Now serviceType and companyType could be a String, enum, or refernece to Objects (ServiceType, CompanyType) saved on a DB on its own table;
This last option is useful if you want change name to one pre-existing type say (Gold change in GOLD), this changes is very simple changing only one record on a Service_Type DB table, while it's expensive when retriving object from database.
Converse adventage for String mapping.