Re: Design Best Practice Question
Re: Design Best Practice Question
- Subject: Re: Design Best Practice Question
- From: Arturo Perez <email@hidden>
- Date: Tue, 22 Mar 2005 13:56:36 -0500
James Cicenia wrote:
Hello -
I have the following scenario.
Portfolio -->> MetricTypes
Project -->> MetricTypeValues --> MetricType
However, a project doesn't have to have a value for each metric type,
however, it needs to display the list of metric types.
My suggestion is to carefully examine MetricType for further semantic
meaning. In other words, rarely is it the case that something like
MetricType is really just a simple value. Perhaps MetricType drives
calculations in other pieces of your system? In that case it may be
worthwhile to include that functionality as part of a more complete
MetricType. Kind of a Strategy design pattern point of view.
You may also want to look at the Java paper on Type Safe Enums.
Let me give an example. One of my old systems had Source as an
attribute. This attribute was usually seen as a simple integer value
(e.g. Source = 5, "oh, it's a magazine"). On the other hand, the value
of Source influenced the formatting of other objects, had a quantity
associated with it, had icons and other presentational aspects, etc,
etc. In that situation, making Source into a full-blown object had big
payoffs. That way all those functions of Source could be consolidated
into one area rather than strewn all throughout the system.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden