Re: Application architecture question
Re: Application architecture question
- Subject: Re: Application architecture question
- From: Theron Blount <email@hidden>
- Date: Wed, 10 Jul 2002 10:51:14 -0700
The single controller and mulitiple views design works, as Ondra has
explained, as long as your code is not sufficiently complex. If the views
get too complex you may need to implement smarter data sources, also.
Cheers,
Theron
>
On Wednesday, July 10, 2002, at 09:21 , Mark de Jong wrote:
>
>
> Let say I have a non-document based app that has a "main" window. This
>
> window contains two NSOutlineView objects and a three-item NSTabView
>
> object where each of the tabs contain NSScrollView objects with NSText
>
> objects in them.
>
>
>
> Got that? :-)
>
>
>
> If I have a class called "AppController", I could manage all these views
>
> in that one class by making it the delegate and necessary data sources
>
> for all the above-mentioned views.
>
>
>
> However, when I do this, I have all kinds of conditional statements
>
> within the delegate methods to determine which view should be handled,
>
> based on which "sender" object is passed into the method.
>
>
Well, so far as I can say, there's no "The Only Pattern To Be Used Always"
>
. Using a specific controller for each view is the cleanest way and for
>
any bigger code I'd definitely recommend that; OTOH, if the appropriate
>
code happens to be really simple, it would mean a quite unnecessary burden.
>
>
Therefore, I'd say you just have to judge yourself: so far as the code is
>
simple enough so that all those ifs are perfectly readable and easily
>
manageable (and the probability it would change in next release is
>
negligibile), don't bother with more controllers. Otherwise, do ;)
>
---
>
Ondra Cada
>
OCSoftware: email@hidden http://www.ocs.cz
>
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.