• 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
Re: Lots of Core Data Attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Core Data & Bindings & dynamic contents - newbie question
  • Next by Date: Re: NSTableView & different columns
  • Previous by thread: Re: Lots of Core Data Attributes
  • Next by thread: Re: Using gcc 2 on 10.4.1 with XCode 2.1. Confirmation request.
  • Index(es):
    • Date
    • Thread