Core Data, questions about two models in an application
Core Data, questions about two models in an application
- Subject: Core Data, questions about two models in an application
- From: rakel <email@hidden>
- Date: Mon, 17 Jul 2006 14:43:45 +0200
Hi all,
I'm developing an application where data about persons can be
managed. My data model contain two types of entities, meta data and
person data. A meta data entity can be e.g. Variable. A person
entity can be e.g. Value. There is a relation between the Variable
and the Value entities, and also between the Value and the Person
entities -- a person has a value for a variable, another person has
another value for the same variable.
E.g. let there be a Variable called with title "Operating System".
Then the person with name "Piglet" can have a Value for this Variable
with the "valueData" attribute set to "Windows" and the person
"Winnie the Pooh" can have a Value for the same Variable with
"valueData" attribute set to "Mac OS X".
One way is to start with a "Core Data Application" in XCode and have
one data model with the entities Person, Value and Variable (this is
how I currently do it).
Now to my question:
Another way could be to use a "Core Data Document Based Application"
where each person is represented by one document. But since the
Variables doesn't belong to any specific person, the Variable data
cannot be part of the documents. Hence I would need two models, one
model for the meta data and one model for the person data. Data for
the "person data model" would be saved with each document. Data for
the "meta data model" would be saved "somewhere else". Also, there
must be a connection between the Value entity in the "person model"
and the Variable entity in the "meta data model".
How do I do this? (Specifically, how do I maintain a relation between
two entities in two different models?)
Kind regards
/Dan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden