views:

89

answers:

3

Hi, I've got a medium sized project (about 20 critical classes) where I'm using sqlite for my data store. All of my objects and data structures comply with the NSCoding protocol. I've been reading up on all the great bells and whistles Core Data has to offer and would like to migrate my app to use Core Data.

The bells and whistles i'm interested in are:

  • Built in undo/redo
  • Automatic property validation

What should I make sure I do (I guess as a checklist) to migrate my app to Core Data?

I find myself adding these features in myself, and can see the value in just biting the bullet to get this stuff for "free." i've already invested a good amount of time with sqlite. So as a side question, is it even worth the time and effort?

Thanks!

EDIT: additional comment and clarification

I'm also asking if anybody's here has already done this and what problems and challenges, in your experiences, did you come across? My hunch is that it's not exactly that straight forward.

+1  A: 

Whether it's worth it to drop your existing code and use Core Data depends on how much you expect to change your data model over time. If it's not broke, why fix it?

That being said, I would go ahead and spend a few hours with the modeler in Xcode and see how easy it is to make a core data model that closely corresponds to your existing schema.

NSResponder
thanks, and that's what i'll probably be doing.
pxl
A: 

Here's how I'd approach it: I would weigh the amount of time it would take you to completely rearchitect your application to accommodate Core Data against the amount of time it would take you to implement by hand the features that Core Data would give you "for free". Those features really only come for free when you've planned to use Core Data from the start.

For you, since you already have an established, tested model, it's going to cost you a lot. Like, 100% or more of what it cost you to build the model code in the first place. Unless your model code is badly in need of an overhaul, I doubt it will be worth the investment for you.

Alex
don't tell me this, core data seems so nice and shiny
pxl
Haha, sorry. It is nice and shiny, but if it makes you feel any better, there are times with Core Data that I wish I had the control and flexibility to just dig in and write the SQL statements myself. There are always trade offs.
Alex
A: 

Don't under-estimate the memory management/performance benefits that Core Data brings to the table.

Esepcially on the iPhone, these are probably the most important gains, especially when you're dealing with thousands of records.

Terry Wilson