Re: Should I learn CoreData for this project?
Re: Should I learn CoreData for this project?
- Subject: Re: Should I learn CoreData for this project?
- From: Ruotger Skupin <email@hidden>
- Date: Wed, 4 Nov 2009 11:33:13 +0100
more disadvantages to mention:
1. schema updates with every model change if you use an sql store (you
have to make a mapping for every single from version/ to version
combination you need to support)
2. multithreaded core data is very hard to get right (multiple
contexts, data merges)
3. performance tuning of core data often means making your schema more
complex (see also point 1)
4. debugging core data can be hard (most bugs only get to the surface
when you try to save your data).
5. core data throws exceptions all over the place so you may end up
with a try-catch block with every data access in your code
If your data set fits in memory and you don't mind loading it all at
once, stay away from core data.
my two cents
Ruotger
On 04.11.2009, at 08:54, Kai Brüning wrote:
Hi David,
this question is most definitely on topic :-)
So, lets see, what would Core Data give you:
- Scalability, fast incremental loads and saves for big data sets.
I don’t think you’ll need this. Loading and saving 500 items each
time will be fast enough.
- A data model modeler.
That’s actually more valuable then it may seem on first glance. I
often look at my Core Data models when thinking about algorithms and
want to recap how the object graph looks.
- Automatic and semi-automatic version migration.
Depends on the lifecycle of your application. When needed, it’ll
save you tons of time.
- Object graph consistency management.
A big one. Core Data automatically updates inverse relationships as
needed. A lot of work to do manually, and always a source of subtle
bugs.
- Automatic undo support.
Big
- Disadvantage: Core Data does not support ordered relationships.
That is, it uses sets instead of arrays. If you need an order, you
have to manage this yourself. Not hard, but sometimes an annoyance
(the reason for this "shortcoming" are hard technical problems).
That’s it out of my head. I’m sure I forgot something.
The learning effort? Hard to say. Core Data is well documented and
works (almost always) as advertised. So it depends on how well you
learn new abstractions.
One unrelated advice: by all means use garbage collection. It makes
object graph management (and a lot of other things) so much easier,
no matter whether you use Core Data or not.
Good luck!
Kai
On 4.11.2009, at 05:22, David Hirsch wrote:
So, I'm hearing folks sing the praises of CoreData, which I have
not yet learned. It seems like a long uphill climb, but if life
will be spectacular afterwards, I'll do it. I am a semi-casual
programmer; I've just finished a couple of small programs that do
not use CoreData, and I can see the advantage in gaining open/save
and undo/redo for free, but I'm concerned about the work I'll have
to put in to learn it. I've read a bunch of the CoreData intro
documentation, but it doesn't give a feel for how difficult it will
be to learn, nor how big the advantages are if I do.
Here's the next project I'm going to work on, for which I'm
considering CoreData:
A simulated annealing code for class scheduling. The CoreData part
would lie in managing all the lists involved: classes, rooms,
instructors, preferences, conflict cost weights, etc. I estimate
that I will have about 500 items spread over about 10 arrays. I
would not expect to have a complex object graph (if that's the
right term) - just a lot of items in lists, items that need to be
managed, displayed, saved, loaded, etc. I could use NSArrays for
all these, which I currently understand.
Does this sound like it's worth learning CoreData for?
Thanks,
Dave
S.A.: I hope this is on topic; I think it is.
Those recent projects I mentioned:
http://almandine.geol.wwu.edu/~dave/research/code/ModeMaker/
http://almandine.geol.wwu.edu/~dave/research/code/ModeQuiz/
============================
Dave Hirsch
Associate Professor
Department of Geology
Western Washington University
persistent email: email@hidden
http://www.davehirsch.com
voice: (360) 389-3583
aim: email@hidden
vCard: http://almandine.geol.wwu.edu/~dave/personal/DaveHirsch.vcf
============================
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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