NSDocument vs sqlite records
I'm developing a cocoa application that could be used to manage customer and employee details in a small business.
When I read through the NSDocument
architecture, I believe that the document/window management and workflow it gives you is excellent, however I am trying to figure out how that architecture fits into (if at all) an application that reads each record from a database, instead of from individual files.
I think I could "fudge" some of the file-based operations in the workflow to read individual database rows instead of files, but I wonder if that is going to bite me later on.
Am I better off just ditching the NSDocument
path and building my own Window- and Document-Controllers? Any thoughts?
Along the same lines, are there any books that describe "application design" i开发者_如何转开发n the cocoa world? The Hillegaas book is outstanding for describing the bottom-up approach, but it would be nice to get some guidance about designing/building real-world, complex apps (for those of you with Eclipse RCP experience, there is a great book called "Eclipse Rich Client Platform: Designing, Coding, and Packaging Java Applications" - something like that for Cocoa would be awesome). Anything out there like that?
You could either have your application backed by one sqlite database or store all the records in a file.
NSDocument-based applications are for when your application reads/edits/creates a file. Applications like this include text editors, image editors, pdf viewers, that sort of thing.
If you wanted your users to be able to create/edit/delete the databases you create and perhaps keep several different databases on their computer, NSDocument makes that super convenient.
If your intent is to give your users access to one single database that they an add/remove records to, you don't want to bother with NSDocument.
精彩评论