views:

373

answers:

2

I am trying to understand the key differences between these two types of Core Data application templates.

My understanding is that with a document based core data app you get access to NSDocument instances and a lot of document based behaviors for free (save dialogs, undo, etc).

Assuming I want to create an application that is more "Project" based and not necessarily focused on creating individual savable documents should I still use Core Data with Documents?

To be more concrete, I am trying to build a simple CMS application using core data and that outputs html pages in a structured way. The idea of the app would be focused on "sites" that are really projects and not single documents. The projects contain a consolidated model for various posts, pages, sidebar content, and whatever content might need to go into a website. But the app doesn't save individual pages as documents in the traditional sense. I want a unified model of the all the project data and provide export functionality where the entire application model would become expressed as a set of html documents in a specified project folder.

This is both a learning exercise and something I want to try and build for myself.

Any tips on specific documentation to read? In particular information about "Project" based cocoa apps, and useful samples and tutorials.

It is conceivable that the CMS data model could be stored in a single Core Data document but that doesn't necessarily seem right from an architectural point of view.

+1  A: 

A project can be a document and a document doesn't have to be a single file. Read the NSDocument related documentation and decide if it offers any functionality you might be interested in.

Azeem.Butt
Ok, thanks. That was what I was wondering.
Gordon Potter
+2  A: 

I look at the difference as being that a Document based application lets the user have multiple sets of information stored separately.

The best example, from a functionality perspective, is iTunes. Apple doesn't let you have multiple libraries, it's all or nothing, one "database" for the entire application.

A simple document based application would be something like TextEdit.

I don't think what you are proposing is too different from a single document based application, though - you just need to remember that the web pages you produce are an OUTPUT, not a part of the project. The same way you don't think of printed output from TextEdit being part of the document. Or object/executable files in XCode being part of the project.

Jeff Laing