Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: unidirectional relationships



I have had to deal with this also. I think that the best solution is to just
have those empty back links and accept the clutter. You could also have
subclasses of employee, but i am sure that would cause other problems.

On 2/13/08, Ruotger Skupin <email@hidden> wrote:
>
> Hi,
>
> consider the following example (that what I would like to model):
>
> Entity: Department
> Attributes: ...whatever...
> Relationships:
> headOfDepartment --> Employee
> viceHeadOfDepartment --> Employee
> pointyHairedBoss -->
> dilbert -->
> other Employees -->>
>
>
> Entity: Employee
> Attributes: ...whatever...
> Relationships:
> department --> Department
>
>
> Every Employee is only in one Department. The Department has (and
> needs) four special Employees (head, vice head, pointy haired boss,
> dilbert). Turns out that it is impossible to model this with
> bidirectional relationships if you don't want to model it like that:
>
> Entity: Employee
> Attributes: ...whatever...
> Relationships:
> departmentImHeadOf --> Department
> departmentImViceHeadOf --> Department
> departmentImPointyHairedBossOf --> Department
> departmentImDilbertOf --> Department
> departmentOtherEmployeeOf --> Department
>
>
> The other alternative is to model it with unidirectional relationship,
> which is discouraged.
>
> Can anyone gime some advice on this?
>
> Ruotger
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Core Data: unidirectional relationships (From: Ruotger Skupin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.