FROM : Bill Bumgarner
DATE : Wed Jun 15 01:44:13 2005
On Jun 14, 2005, at 4:27 PM, John Brownlow wrote:
> Or you can start writing linked lists which do much the same thing
> except that they maintain pointers to 'nextItem' instead of keeping
> an index, but it's just as ugly.
Actually, depending on context of implementation, using a linked list
is both quite easy and very efficient. Obviously, inserting/deleting
objects into a linked list is trivial and fast if you have both a
next and a previous pointer. Given that Core Data will maintain the
inverse relationship automatically, it will also maintain the linked
list pointers automatically.
Given that many UI type usage contexts will require all of the
objects to be faulted into memory anyway, walking the "next"
relations and filling an NSMutableArray for display purposes is about
three lines of code.
So, for the particular example of Screenplay -> Scenes, a linked list
might very well be a totally acceptable way of modeling this.
In this particular example, the amount of overhead in the form of
additional lines of code incurred by the developer is pretty trivial.
Yeah -- it is a bummer that Core Data doesn't have direct modeling of
ordered relationships. See my other email for why that decision was
made.
b.bum
DATE : Wed Jun 15 01:44:13 2005
On Jun 14, 2005, at 4:27 PM, John Brownlow wrote:
> Or you can start writing linked lists which do much the same thing
> except that they maintain pointers to 'nextItem' instead of keeping
> an index, but it's just as ugly.
Actually, depending on context of implementation, using a linked list
is both quite easy and very efficient. Obviously, inserting/deleting
objects into a linked list is trivial and fast if you have both a
next and a previous pointer. Given that Core Data will maintain the
inverse relationship automatically, it will also maintain the linked
list pointers automatically.
Given that many UI type usage contexts will require all of the
objects to be faulted into memory anyway, walking the "next"
relations and filling an NSMutableArray for display purposes is about
three lines of code.
So, for the particular example of Screenplay -> Scenes, a linked list
might very well be a totally acceptable way of modeling this.
In this particular example, the amount of overhead in the form of
additional lines of code incurred by the developer is pretty trivial.
Yeah -- it is a bummer that Core Data doesn't have direct modeling of
ordered relationships. See my other email for why that decision was
made.
b.bum
| Related mails | Author | Date |
|---|---|---|
| David Dunham | Jun 11, 19:19 | |
| Markus Hitter | Jun 11, 22:43 | |
| mmalcolm crawford | Jun 12, 04:03 | |
| David Dunham | Jun 13, 02:08 | |
| mmalcolm crawford | Jun 13, 02:47 | |
| David Dunham | Jun 13, 05:43 | |
| Erik Price | Jun 14, 03:41 | |
| David Dunham | Jun 14, 04:50 | |
| Johnny Deadman | Jun 14, 15:04 | |
| Óscar Morales Vivó | Jun 14, 15:19 | |
| mmalcolm crawford | Jun 14, 15:49 | |
| SA Dev | Jun 14, 15:57 | |
| John Brownlow | Jun 14, 16:13 | |
| Markus Hitter | Jun 14, 16:28 | |
| Bill Bumgarner | Jun 14, 17:50 | |
| Bill Bumgarner | Jun 14, 18:17 | |
| Chris Hanson | Jun 14, 23:38 | |
| Chris Hanson | Jun 14, 23:44 | |
| John Brownlow | Jun 15, 01:27 | |
| Bill Bumgarner | Jun 15, 01:44 | |
| Johnny Deadman | Jun 15, 02:22 | |
| Sharon Rosner | Jun 15, 05:30 | |
| Bill Bumgarner | Jun 15, 08:06 | |
| Markus Hitter | Jun 15, 10:41 | |
| mmalcolm crawford | Jun 15, 11:05 | |
| Markus Hitter | Jun 15, 12:45 | |
| Sharon Rosner | Jun 15, 14:13 |






Cocoa mail archive

