FROM : Paul Mix
DATE : Sat Apr 30 01:03:43 2005
Ah, finally I can ask the Core Data question that's been bugging me
for a long time.
I really like how easy it is to use NSPersistentDocument, and how
well-integrated it is with IB and Bindings. However, this class
assumes the standard 1-file, one NSDocument paradigm. It creates its
coordinator automatically, and is tied to a single file/URL.
What I'm curious about is how best to use the new CoreData/
persistence classes to emulate the typical database-driven approach,
where you have a single database file, but with with multiple
documents providing interfaces to it.
As an example, say I'm writing a program to keep track of Personnel.
The primary entities would be Person and Group. I'd like to store all
these entities in a single SQLite database using CoreData. However,
rather than using a single "document" with a master/detail interface,
I'd rather have one window showing a list of all Persons or Groups,
and a separate editor "document" window to edit each Person or Group.
These editor windows should behave just like normal a normal
NSPersistentDocument with regards to how it interacts with the store,
but I want all of the documents to read and write from the same
database file on disk. Changes made in one Person editor would not
affect those in any other editor until the document was saved (i.e.
the changes committed).
What's the best approach for handling a paradigm such as this?
Thanks,
- Paul M
DATE : Sat Apr 30 01:03:43 2005
Ah, finally I can ask the Core Data question that's been bugging me
for a long time.
I really like how easy it is to use NSPersistentDocument, and how
well-integrated it is with IB and Bindings. However, this class
assumes the standard 1-file, one NSDocument paradigm. It creates its
coordinator automatically, and is tied to a single file/URL.
What I'm curious about is how best to use the new CoreData/
persistence classes to emulate the typical database-driven approach,
where you have a single database file, but with with multiple
documents providing interfaces to it.
As an example, say I'm writing a program to keep track of Personnel.
The primary entities would be Person and Group. I'd like to store all
these entities in a single SQLite database using CoreData. However,
rather than using a single "document" with a master/detail interface,
I'd rather have one window showing a list of all Persons or Groups,
and a separate editor "document" window to edit each Person or Group.
These editor windows should behave just like normal a normal
NSPersistentDocument with regards to how it interacts with the store,
but I want all of the documents to read and write from the same
database file on disk. Changes made in one Person editor would not
affect those in any other editor until the document was saved (i.e.
the changes committed).
What's the best approach for handling a paradigm such as this?
Thanks,
- Paul M
| Related mails | Author | Date |
|---|---|---|
| James Clause | Apr 29, 16:49 | |
| John Brownlow | Apr 29, 17:36 | |
| Scott Stevenson | Apr 29, 19:07 | |
| John Timmer | Apr 29, 22:34 | |
| John Timmer | Apr 29, 23:28 | |
| Bill Bumgarner | Apr 30, 00:00 | |
| John Timmer | Apr 30, 00:29 | |
| Scott Ellsworth | Apr 30, 00:43 | |
| Chris Hanson | Apr 30, 00:56 | |
| Paul Mix | Apr 30, 01:03 | |
| John Timmer | Apr 30, 01:13 | |
| Scott Stevenson | Apr 30, 01:15 | |
| Scott Stevenson | Apr 30, 01:18 | |
| mmalcolm crawford | Apr 30, 01:47 | |
| Bill Bumgarner | Apr 30, 09:49 | |
| Paul Mix | Apr 30, 16:38 | |
| mmalcolm crawford | May 1, 00:09 |






Cocoa mail archive

