Re: Use NSDocument as a variable of another NSDocument
Re: Use NSDocument as a variable of another NSDocument
- Subject: Re: Use NSDocument as a variable of another NSDocument
- From: Jeffrey Oleander <email@hidden>
- Date: Mon, 18 Jan 2010 13:59:26 -0800 (PST)
> At Mon, 2010/01/18 15:19, Quincey Morris <email@hidden> wrote:
> On 2010 Jan 18, at 10:48, Jarod Wen wrote:
>> Is it a proper design to use a NSDocument as a
>> variable of another NSDocument?
>>
>> I am now working on an application which generates
>> some information from a movie. The information
>> generated will be showed as a table, and the
>> information in the table can be saved/opened.
>> Multiple types of information are possible
>> so for one movie there may be several tables.
>>
>> I used the NSDocument architecture for the movie
>> document, and I am a little bit confused about
>> the hierarchy...
> The question isn't whether one document object
> can contain a reference to another document
> object. The question is what's supposed to
> happen later when the derived (table)
> document is re-opened.
>
> If the table refers to information in the
> original (movie) document, you'll need to
> open the movie document too.
That depends on what you mean by "refers to".
I can refer to the Encyclopedia Brittanica
without opening it. I can say "this is
related to the movie 'Blah' whose screen-
play was written by Blurp, was direced
by Blorp, and produced by Bloop" without
having to open up that movie file.
It just depends on what Jarod Wen wants
to do.
If he wants the extracted data which he
displays in tables to be mostly independent
of the original movie, then he will need
that to be in a document with its own
hierarchy. The original movie would be
one document with its own data,
and the extracted data for that movie might
be a separate document with its own,
independent data hierarchy. If he does
that, then the 2 files can diverge, and
he might have to consider how to control
proliferation of related data files,
each derived from the same movie file.
So, his question becomes, what object
owns each document type? What object
owns the movie? What object owns the
derived data that he displays as tables?
Or, should he just keep only the movie
document and extract/generate at run-
time the data to display in table views
as "views of the movie".
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden