Re: MVC paradigm: multiple controllers?
Re: MVC paradigm: multiple controllers?
- Subject: Re: MVC paradigm: multiple controllers?
- From: Scott Stevenson <email@hidden>
- Date: Tue, 5 Oct 2004 14:31:10 -0700
On Oct 5, 2004, at 12:51 PM, Keith Blount wrote:
For instance, like I say, I have a table view that shows some of the
same data as an outline view (much like in Xcode) - should they both
use the same controller? If not, how can they both access the same
data? Surely the data class has to be instantiated in only one place?
But if they should use the same controller, then it will get pretty
long and unmanageable when all the delegate methods for the outline
view and the table view are implemented along with all of the saving
and opening of documents etc.
I'm not sure there's any hard and fast rule for every situation you've
described. For the most part, though, I think people feel each separate
window should have an NSWindowController subclass managing it.
In terms of keeping things in sync, don't overlook bindings or
key-value observing. NSOutlineView doesn't support direct bindings in
interface builder yet, but you can use *manual* (aka 'programmatic')
bindings to sync the underlying data between your various controllers.
Also, when your classes get long and unwieldy, don't foget about
categories! They are fantastic for breaking up very long classes into
manageble, bite-size chunks.
- Scott
--
http://treehouseideas.com/
http://theobroma.treehouseideas.com/ [blog]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden