Re: Interfaces and Java Client
Re: Interfaces and Java Client
- Subject: Re: Interfaces and Java Client
- From: Paul Lynch <email@hidden>
- Date: Thu, 27 Apr 2006 09:13:20 +0100
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden