Managed Object wants a per-relationship attribute?
Managed Object wants a per-relationship attribute?
- Subject: Managed Object wants a per-relationship attribute?
- From: Jerry Krinock <email@hidden>
- Date: Sat, 15 Sep 2007 18:35:13 -0700
It thought this would be a natural for Core Data, but I've run myself
into a conceptual wall.
Say that I'm modelling a swimming meet. My data model has two
entities: Events and Swimmers. Of course, each Event requires
multiple Swimmers, and each Swimmer can swim in several Events.
My Events should show swimmers ordered by speed: 1st, 2nd, 3rd, etc.
Since CoreData's to-many relationships are not ordered, I add to
Swimmer a 'position' attribute. In the 100-meter freestyle Event,
Suzie's position is 1 and Jane's position is 2. But in some other
event, say the 200-meter butterfly, Jane is faster than Suzie, so the
positions need to be reversed. But I can't do that since each
Swimmer only has one 'position' attribute.
I can easily extend some Apple examples to run into the same wall.
Imagine in CoreRecipes, if you added a Pantry entity which contained
common Ingredients used for different Recipes. The 'displayOrder'
attribute would be conflicted among the different Recipes in which
the Ingredient was used. Or, imagine in DepartmentsAndEmployees, if
you added a Projects entity, with Employees having a different
'function' in each project?
Duh! What's the proper way to model this?
Much thanks,
Jerry Krinock
_______________________________________________
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:
This email sent to email@hidden