You may want to use entity inheritance to design your model; see
http://developer.apple.com/documentation/WebObjects/UsingEOModeler/
7ModelingInheritance/chapter_7_section_1.html
The only thing I'll add is that, from experience, most of the times
that using inheritance is possible, I choose to flatten out the model
instead. Other people may have different experiences. From the OO
viewpoint, a complex design has the same problems as
overnormalisation has in relational database design.
Paul
On 26 Apr 2006, at 15:55, David Avendasora wrote:
Okay, maybe I need to re-think my architecture (won't be the first
time!) Let me give a quick run-down of an example of the basic
structure and maybe someone can give me some tips on how to
architect it in a nice OO/WO way.
I have a Superclass of Part and three subclasses of Raw,
Intermediate and Finished. (this is not a case of a state change,
they are three different types of Parts)
Intermediate and Finished will have a BillOfMaterial because they
are both built from one or more other Parts. Since not Raw cannot
have a BillOfMaterial I cannot relate BillOfMaterial to Part. Right
now, instead of saying that these two classes are related directly
to BillOfMaterial they both implement a IHasComponents Interface
and the BillOfMaterial is related to IHasComponents.
Raw and Intermediate can be BillOfMaterialComponent because they
can be used to make other Parts. Finished cannot, so I have both
Raw and Intermediate implementing IIsComponent and
BillOfMaterialComponent is related to IIsComponent.
It doesn't matter to a BillOfMaterial what type of Parts make up
its components, only that they have some specific attributes and
methods.
Isn't this the proper OO/Java way to handle these types of
relationships?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to archive@mail-archive.com