title: Shoebox / Library applications with Auto-Save & Versions in OS X Lion
body: <p>We have a shoebox-style application that we want to make a first-class citizen in Lion. This means integrating Auto-Save &amp; Versions among other things. Currently we don’t have a document-centric model and we just use a plain Core Data stack.</p>
  
  <p>UIPersistentDocument provides a really easy way to integrate both Auto-Save &amp; Versions and I see two options we could choose from to integrate with the new APIs:</p>
  
  <ol>
  <li>“Abuse” NSPersistentDocument for our shoebox-style application. Technically it would be a document-based application, but the user interface would still be the same iPhoto-like library. This makes conceptually not a lot of sense, but we would get a lot of functionality for free.</li>
  <li>Keep the current plain Core Data stack and implement Auto-Save &amp; Versions manually.</li>
  </ol>
  
  <p>I heard contradicting opinions from Apple representatives about the approach we should take and it would be great to clarify things before we start our implementation. While I think that 1. shouldn’t be used it’s also very tempting, because we get a lot for free. I couldn’t even find sufficient documentation on manually implementing Auto-Save &amp; Versions in a Core Data application.</p>
  
  <p>I would really tend to use 1. but I see some problems:</p>
  
  <ul>
  <li>I’m worried about file-system-level conflicts when using versions and only one database-file. I couldn’t find any documentation regarding this topic.</li>
  <li>I’m worried about performance issues in Versions when browsing through “space”.</li>
  <li>We can’t enforce only one instance of the open database, since Versions has to open several instances. I’m worried about side-effects and concurrency issues.
  Conceptually it looks like a hack and I don’t like hacks.</li>
  </ul>
  
  <p>If we would only want to integrate iCloud sync I definitely wouldn’t think about using a document-centric model for our application, because Core Data supports it directly. I’m mostly worried about the developer overhead we would have if we would stick to our current non-document based paradigm.</p>
  
  <p>Do you have any advice or ideas how shoebox applications should be integrated in the new Lion world?</p>