Shoebox / Library apps with autosave and versions in OS X Lion

We have a shoe-style app that we want to make a first-class citizen at Lion. This means, among other things, the integration of Auto-Save and Versions. We currently do not have a document-oriented model, and we just use a simple Core Data stack.

UIPersistentDocument provides a really easy way to integrate both Auto-Save and Versions, and I see two options that we could choose to integrate with the new APIs:

  • "Abuse" NSPersistentDocument for our shoe style app. Technically, it will be a document-based application, but the user interface will still be the same iPhoto-like library. This conceptually doesn't make much sense, but we would get free functionality.
  • Keep the current simple stack of Core Data and automatically save and version manually.

I have heard conflicting opinions from Apple representatives regarding the approach we need to take, and it would be great to clarify the situation before we begin our implementation. Although I think that 1. you should not use it is also very tempting, because we get a lot for free. I could not even find sufficient documentation on the manual implementation of Auto-Save and Versions in the Core Data application.

I would really like to use 1. but I see some problems:

  • I am concerned about file system conflicts when using versions and only one database file. I could not find documentation on this topic.
  • I am worried about performance issues in versions when viewing "space".
  • We cannot use only one instance of an open database, since Versions must open multiple instances. I was worried about side effects and concurrency issues. Conceptually, it looks like a hack, and I don't like hacks.

If we wanted to integrate iCloud synchronization, I would definitely not think about using a document-oriented model for our application, because Core Data supports it directly. I was mostly worried about the developers' overhead that we would have if we adhered to our current non-document based paradigm.

Do you have any tips or ideas on how shoe apps should be integrated into the new Lion world?

+7
source share
1 answer

I am afraid that you are forced to use the first option. Versions are implemented inside NSDocumentController * sic *, so you will need to use some kind of NSDocument to get any version. I think you also need to add the application window in NSWindowController to this document in order to get a small little pop-up menu at the top. The problem is that versions are more or less completely opaque ...

But there is a question that you must answer yourself: what parts of your application do you want to put in the version? Does it make sense to have everything in one file when it comes to data recovery? Version recovery (except copy and paste) occurs at the file system level. And so, does it really make sense to always restore everything at once? If your answer is no, you may even have to cut your model into several smaller files ...

Do not expect improvement here until the next major release. This is what I guessed from the engineers comments ...

+3
source

All Articles