On Sep 11, 2008, at 2:09 AM, Ken Tabb wrote:

Morning folks,

I was reading the Core Data version migration documentation, and it seems easy to use (haven't put it into practice yet as I was reading it on a sunbed on hols, and I have enough trouble sneaking programming books into the shared luggage, let alone the laptop etc.).

The docs are understandably written from a "how do I upgrade user's software version without wrecking their existing data" perspective, but I was wondering if:

[1] The same model migrations can be used to save documents as a previous version format (eg. save a file from v2.app as v1.xml format instead of v2.xml format, so they can send stuff to their mates who use the older version). Obviously assuming they don't mind losing the "new features" that won't be in v1.xml.

Absolutely. The store migration support facilitates transforming store data from one model version to another, it has no concept of new/ old.

[2] on a related note, if it's possible to generally save documents as sqlite (for compression purposes / atomic saving benefits etc.) but offer a "save as XML" type feature, so that your file format can be used by other apps. Or am I going about this the wrong way / might the XML file format change internally between Core Data revs, thus breaking any file reading ability other apps might have for my app's files?

Or for [2] would I be "better off" rolling my own text-based file format ([self twitch]) so that Core Data's internal SQL / XML formats can change without affecting my documents' readability in other apps?

The XML data format is human readable, but CoreData "owns" the format and I wouldn't recommend letting a non-coredata client edit that file. Along with the migration work that was introduced in Leoaprd, we also added support for writing your own custom store type where you control the on-disk data format - this is exactly the kind of thing you'd want to use it for.
Documented here 
http://developer.apple.com/documentation/Cocoa/Conceptual/AtomicStore_Concepts/Introduction/Introduction.html
example here http://developer.apple.com/samplecode/HTMLStore/index.html

Put another way, how do you go about having a Core Data doc-based app that can't be accused of having a proprietary (i.e. unreadable) file format as its native file format? That's not a criticism, just an innocent question!

I have tried to read all the Core Data docs I could find, so apologies if I've missed the obvious.

Thanks in advance for any light you can shed,
Ken

- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer Science
University of Hertfordshire, UK


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/aswift%40apple.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to