G
Guest
Modeling of Lookup Values and ORM
I know this is not the correct forum for object design patterns, but I
haven't found any design related newsgroups.
Scenario:
Customers (table)
-----------------
CustomerID
Name
CustomerTypeID
.... other properties ...
CustomerTypes (table)
---------------------
CustomerTypeID
Type
===================================================
So, if I am modeling a customer entity, how do I represent the Type of the
Customer based on accepted practices? The dilemma is that when it comes to
updating or adding a Customer it makes more sense to reference the
CustomerTypeID. However, when displaying data to the user I want to show the
string representation (CustomerType.Type). Should objects that have these
"lookup" values represent these properties as:
public struct NamedValue
{
public object Name;
public object Value;
}
???
How do you handle this with solutions you design?
I know this is not the correct forum for object design patterns, but I
haven't found any design related newsgroups.
Scenario:
Customers (table)
-----------------
CustomerID
Name
CustomerTypeID
.... other properties ...
CustomerTypes (table)
---------------------
CustomerTypeID
Type
===================================================
So, if I am modeling a customer entity, how do I represent the Type of the
Customer based on accepted practices? The dilemma is that when it comes to
updating or adding a Customer it makes more sense to reference the
CustomerTypeID. However, when displaying data to the user I want to show the
string representation (CustomerType.Type). Should objects that have these
"lookup" values represent these properties as:
public struct NamedValue
{
public object Name;
public object Value;
}
???
How do you handle this with solutions you design?