Aggregations in a DAG with a Recursive Core Data Structure
Aggregations in a DAG with a Recursive Core Data Structure
- Subject: Aggregations in a DAG with a Recursive Core Data Structure
- From: Mike Rossetti <email@hidden>
- Date: Wed, 11 Jul 2007 09:19:03 -0600
I'm sure this has been asked and answered before but a search of
cocoa-dev using a wide variety of terms failed to come up with
anything useful.
Imagine a basic parts list model with two entities:
item
name
parts (1::n to part)
totalCost
part
name
subparts (1::n to part)
cost
I'd like totalCost to be calculated from the sum of the item's parts
costs. And I'd like each part's cost to be calculated as the sum of
it's subparts' costs. The parts hierarchy can be arbitrarily deep.
Cycles are not allowed.
Is there an example that shows how to implement the totalCost and
cost fields? Preferably using Core Data.
Thanks,
Mike
_______________________________________________
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