• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Managed Object wants a per-relationship attribute?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Managed Object wants a per-relationship attribute?
      • From: mmalc crawford <email@hidden>
    • Re: Managed Object wants a per-relationship attribute?
      • From: Shawn Erickson <email@hidden>
    • Re: Managed Object wants a per-relationship attribute?
      • From: Greg Titus <email@hidden>
  • Prev by Date: Re: How to embed framework in app with setuid helper
  • Next by Date: Re: Managed Object wants a per-relationship attribute?
  • Previous by thread: Re: Capturing the right display, but rendering to the wrong one.
  • Next by thread: Re: Managed Object wants a per-relationship attribute?
  • Index(es):
    • Date
    • Thread