FROM : Scott Stevenson
DATE : Fri Apr 29 19:07:25 2005
On Apr 29, 2005, at 7:49 AM, James Clause wrote:
> I'd like some advice on the best way to use CoreData in various
> situations. I'm trying to create a BibTeX manager. The problem I'm
> facing is that BibTeX allows user defined fields and multiple authors.
> The obvious way to handle this is to store multiple authors as an
> NSArray of NSStrings and the user defined fields in an NSDictionary.
Use a to-many relationship for the authors. These are represented at
code level as NSMutableSets, since Core Data relationships have no
inherent order.
The best implementation I've found for user-defined fields is a
collection of CustomUserValue objects which have a relationship to
their parent object. You can try all day and night to use a dictionary
for this, but you'll only make things hard on yourself. In particular,
you'll limit your ability to do some fancy seaching stuff.
The CustomUserValue should look something like:
customValue - string
internalKey - string
displayKey - string
- Scott
--
http://treehouseideas.com/
http://theocacao.com/ [blog]
DATE : Fri Apr 29 19:07:25 2005
On Apr 29, 2005, at 7:49 AM, James Clause wrote:
> I'd like some advice on the best way to use CoreData in various
> situations. I'm trying to create a BibTeX manager. The problem I'm
> facing is that BibTeX allows user defined fields and multiple authors.
> The obvious way to handle this is to store multiple authors as an
> NSArray of NSStrings and the user defined fields in an NSDictionary.
Use a to-many relationship for the authors. These are represented at
code level as NSMutableSets, since Core Data relationships have no
inherent order.
The best implementation I've found for user-defined fields is a
collection of CustomUserValue objects which have a relationship to
their parent object. You can try all day and night to use a dictionary
for this, but you'll only make things hard on yourself. In particular,
you'll limit your ability to do some fancy seaching stuff.
The CustomUserValue should look something like:
customValue - string
internalKey - string
displayKey - string
- Scott
--
http://treehouseideas.com/
http://theocacao.com/ [blog]






Cocoa mail archive

