Re: Vertical Inheritance qualifier based on to many relationship
Re: Vertical Inheritance qualifier based on to many relationship
- Subject: Re: Vertical Inheritance qualifier based on to many relationship
- From: Lachlan Deck <email@hidden>
- Date: Sat, 20 Aug 2011 20:29:00 +1000
On 20/08/2011, at 6:58 PM, Johan Henselmans wrote:
> On 20 aug. 2011, at 01:26, Chuck Hill wrote:
>
>> On 2011-08-19, at 2:46 PM, Johan Henselmans wrote:
>
> I thought I used a Role pattern. situation:
> base class is contact, others are inheritances all in the same table
Sounds like you're confusing the role pattern with the decorator pattern.
> contact - visitor
> -actor
> -director
> -nice person
>
> role class - (defined via eo)
>
> contact<->role m:n
>
> I would assume that figure 13 in the article would be the most desirable solution, as the role definition is dynamic (roles can be added)
>
>
> <figure-13.gif>
>
> but I do not get how in that situation the specific methods and data of a specific role would then be defined. Or perhaps I miss the point?
>
> For instance, and actor can have a relationship to a specific show, a theatergroup, a paycheck, a visitor can have visited a specific performance, etc. Where would you define that kind of behavior?
On each role's separate entity. That's the point of the role. It is not defined on the EO related to the role, but on the role's destination entity itself.
Each contact can have one or more roles. You can't model that with inheritance but with toOne relationships.
e.g., a director may or may not be a nice person, and so on.
Lachlan Deck
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