Re: Looking for suggestions/help on a multi-file data model

"Michael B. Johnson" <[email protected]> Fri, 11 Feb 2011 18:32:03 -0800
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
It's a great question. If I have time, I'll talk about what I did years ago with the document model to do this. Short answer: it's hard.



On Feb 11, 2011, at 6:12 PM, Andy Akins <[email protected]> wrote:

> I'm working on an application that has multiple files as part of its data model, and I'm not sure on the approach I should take.
> 
> An example of what I mean:
> 
> Imagine a "purchasing" application. First, you have to open a "catalog" - a file that lists the items that are available. There might be multiple files, representing multiple stores or sets of items, but you have to pick just one.
> 
> Then, you have your "order" - you select items from the opened "catalog", and have a new document that contains not only the items you are going to order, but also other information (address, name, etc).
> 
> The catalogs are separate files, and there would be either a separate app or a part of this app to edit a catalog: to add, remove, change items in it.
> 
> But orders are also separate files, that can be saved, edited, printed, etc.
> 
> I've used Core Data and the Document architecture for more simple data models, but I'm not sure if I can shoehorn this into them. I've looked at several tutorials, guides, and even read some books - but they all seem to be the One Document = One File approach. And what I want to do really doesn't fit that.
> 
> Note: The above is just a conceptual example - I'm not really writing a purchasing/catalog system. It was just what I thought of to describe my problem :) The actual product I'm working on is a bit more niche oriented, but the use case of the data involved follows the same concept: the "prime" document (order) is built/constructed using data from a defining document/template (catalog).
> 
> Can anyone point me in a direction to do some more research and/or offer some insight that might help me decide if I can use Core Data and/or Document Architecture, of if I have to go old school and roll my own? Heck, perhaps I can use CD/DA for the primary document, and have the template/definition document be something else.
> 
> I hope this wasn't too obscure - I'm not looking for a concrete solution. Instead, hoping for a little guidance/ideas on what I should try and/or look into.
> 
> Thanks for any insight you might have...
> 
> -- Andy Akins
> _______________________________________________
> MacOSX-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/macosx-dev