Re: Inheritance with records in more than 1 subclass
Re: Inheritance with records in more than 1 subclass
- Subject: Re: Inheritance with records in more than 1 subclass
- From: Ken Anderson <email@hidden>
- Date: Thu, 19 May 2005 20:07:34 -0400
Omar,
In any inheritance hierarchy, you must be able to positively identify
what the final entity/class a record will be. If you have someone
who is both a customer and employee, they should have 2 different
person records. If you have an existing database where this is not
possible, then you cannot use this type of inheritance scheme.
Do you have a way in the person record to identify that they're one,
the other, or both? If so, maybe you should consider having a third
sub-entity, 'EmployeeCustomer'. When I have situations like this and
I need methods for both, I often have the methods in a separate file
that I include in both implementations (I've done this in Objective-C
- not Java). It's sort of a cheating form of multiple inheritance.
In any case, good luck!
Ken
On May 19, 2005, at 7:46 PM, Omar wrote:
Hi all,
I am trying to use single table inheritance for a cetain project I
have on hand but am having problems where a record can be of 2
types, for example in the Apple documentation (http://
developer.apple.com/documentation/WebObjects/UsingEOModeler/
7ModelingInheritance/chapter_7_section_2.html) there are 3 objects,
Person, Employee and Customer.
Suppose the Person is both an Employee AND a Customer, If I first
fetch an Employee WO fetches everything just fine but then later I
try to fetch records from Customer it tells me it can't find
current_order or previous_order for example, it looks like WO is
caching the record and won't refresh it since its a different
class, how can I get this to work properly?
Thanks in advance,
Omar
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com
This email sent to email@hidden
_______________________________________________
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