michaelveloz
Programmer
My question is partly to do with mimicking your domain in your software, and partly to do with finding objects that are associated to one another.
My general question is this: If your domain uses id's to relate entities, should you carry those id's into your objects and use those id's to relate and find objects?
For example, if let's say your domain has the notion of "features" (like feature of a Freezer) and let's say the domain has the notion of Respondents who each provide a rating for each feature.
Now assume in the domain, each feature is assigned an id. Then, each respondent's rating carries the id of the feature the rating is for, so that you can tell what ratings are for which features.
Now, if you were modeling this in OO land .. lets say you have your list of feature objects, and you have a list of respondent object. Each respondent object will have a list of that respondents ratings for each feature.
Here's the question: should the respondent rating objects carry the feature ID.. for lookups, etc, or should they actually hold object references to their corresponding feature objects?
Thanks!
Michael
My general question is this: If your domain uses id's to relate entities, should you carry those id's into your objects and use those id's to relate and find objects?
For example, if let's say your domain has the notion of "features" (like feature of a Freezer) and let's say the domain has the notion of Respondents who each provide a rating for each feature.
Now assume in the domain, each feature is assigned an id. Then, each respondent's rating carries the id of the feature the rating is for, so that you can tell what ratings are for which features.
Now, if you were modeling this in OO land .. lets say you have your list of feature objects, and you have a list of respondent object. Each respondent object will have a list of that respondents ratings for each feature.
Here's the question: should the respondent rating objects carry the feature ID.. for lookups, etc, or should they actually hold object references to their corresponding feature objects?
Thanks!
Michael