Re: When NSArray is not an Array
Re: When NSArray is not an Array
- Subject: Re: When NSArray is not an Array
- From: Gordon Apple <email@hidden>
- Date: Thu, 11 Jan 2007 15:39:44 -0600
> How is this any different than a relational database? If you want
> to have an arbitrary sort order for your records, you still have to
> have *some* key on which to sort the results of the query. You still
> have to update the keys of the relevant records you wish to reorder.
Well, that was kind of my complaint with relational databases in general
as an object backend. Apparently, Core Data has not solved the problem. I
guess its part of what's generally called the "impedance mismatch" when
doing this. We are trying to evaluate whether or not to use Core Data or
role our own with PostgreSQL. The later still has the same problem. I
would rather not use blobs for arrays is there is an alternative. Another
reason to consider Core Data is that SQLite is also available on the OLPC
(MIT laptop) program which we would like to also target.
> in its current incarnation, a sort order
> key or the use of a linked list are the only solutions to this
> limitation of Core Data. I prefer the use of a sortOrder key ... it's
> cleaner and easier to maintain in my opinion and experience. YMMV.
I'm assuming this is what I described with the sequenced index field?
>
> That said, it really isn't *that* complicated to create a generic,
> reusable NSArrayController subclass that updates the sortOrder key
> (along with implementing drag and drop, etc.). The drag-reorder part
> is done for you in several examples on the "Internets" (google "mmalc
> bindings example" and you'll find a ready-made example) and the
> reordering code is easy to add to that.
Thanks. I'll check that out. I was up most of last night before I
realized Core Data didn't handle this natively.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden