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: CoreData implementation of persons with any number of assets



On Jul 26, 2007, at 5:30 PM, Andres wrote:
I'm trying to implement an application using CoreData where I have a person
entity and an asset entity. A person entity has a to-many relationship to
the asset entity and vice-versa. However, I want each person instance to
specify their own quantity of any of the assets. How should I keep track of
the quantity each person wants of each asset?


A classic problem with a mostly simple answer: This is like a "line item" in an order. A line item belongs to an order (in your case, a person), and has a SKU/Product/Whatever (in your case, an asset), and has a "quantity" attribute. You need this to map between person and asset.

  Person:	has many LineItem
  LineItem: 	has one Person, has one Asset, (has "quantity" attribute)
  Asset:	has many Asset

--
I.S.



_______________________________________________

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: 
 >CoreData implementation of persons with any number of assets (From: Andres <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.