Re: Mix & Match?
Re: Mix & Match?
- Subject: Re: Mix & Match?
- From: Rainer Brockerhoff <email@hidden>
- Date: Thu, 29 Nov 2001 13:34:05 -0200
Date: Wed, 28 Nov 2001 14:18:04 -0500
From: email@hidden
With the help of a lot of folks on this and the Project Builder lists I
have finally made some serious progress, prototyping my application in
four parts. As parts everything seems to work fine. So it is now time to
try and meld these parts into one, before I start replacing the test code
with the real deal, but there is still something I don't quite understand
concerning the document-based template and how to expand it.
...
... Nothing "document-based" here that I can tell! The
Persistent Data row however must be document based as text fields can be
edited and the entries stored in an NSMutableArray. Although I have no
need whatsoever of having more that one editing window. Ever!
...
... Now, on the one hand I can see that these two lower layers
might be document-based in that windows are involved, sometimes more than
one, but on the other hand nothing here needs to be saved, duplicated,
printed, or any of the other stuff you typically do with "documents" like
a letter to Aunt Jane or an image of Uncle Joe.
Brian,
AFAIK you need to use NSDocument only if you have a window (or group
of windows) which directly represents a file. Since you're neither
opening nor saving files you shouldn't use NSDocument at all.
I suppose you're saving the "Persistent Data" stuff somewhere, but
there's only one editing window. NSDocuments make sense when you can
have several open, when you want the proxy icon in the window's
header to represent your file, and the corresponding drop-down menu
represent the file's path, and when you have all the open/save/save
as/print paraphernalia implemented for the files. But if you're just
reflecting/editing data saved in a unique location, NSDocument isn't
necessary and may even get in your way, as it will attempt to help
you with the wrong things.
So, if your app is like SimpleText, use NSDocument. If your app is
like, say, ProcessViewer, don't.
HTH,
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"Originality is the art of concealing your sources."
http://www.brockerhoff.net/ (updated Oct. 2001)