Re: Lots of Core Data Attributes
Re: Lots of Core Data Attributes
- Subject: Re: Lots of Core Data Attributes
- From: Philippe Mougin <email@hidden>
- Date: Sun, 3 Jul 2005 02:45:57 +0200
Todd Yandell wrote
> I'm working on a project that needs to store a lot of data
> about individual people. Everything from names, titles and
> salutations and multiple addresses to credit card information.
> My question is this:
> Would I be better off making all of the fields as attributes,
> or should I go with my current solution of using relationships
> for the detailed fields (like addresses and credit cards) and
> only using attributes for the more general info?
Let's take your "address" example: you should use attributes unless
there is a specific reason to use relationships. Such reasons include:
- The number of addresses a person can have is variable.
- Several persons can have the same address, and you want that fact
to be represented by your model without redundancy.
- You want to be able to store and manage addresses that are not (or
not yet) associated with a particular person.
- There are functional dependencies between the fields that describe
an address, and you want to capture that in your model (in this case
you will split the address itself into multiple entities).
More precisely, I would advise to first design (at least mentally)
your data model as a relational model (using relational normalization
and other well documented principles) and then translate it to a Core
Data model (which is trivial to do). This will helps you get good
Core Data object graphs.
Best,
Philippe Mougin
The open source Cocoa scripting language: http://www.fscript.org
_______________________________________________
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