• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Application architecture question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Application architecture question


  • Subject: Re: Application architecture question
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 10 Jul 2002 13:34:12 +0200

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.
References: 
 >Application architecture question (From: Mark de Jong <email@hidden>)

  • Prev by Date: Re: Starting Cocoa development - Developing for Jaguar
  • Next by Date: Re: autorelease problem
  • Previous by thread: Application architecture question
  • Next by thread: Re: Application architecture question
  • Index(es):
    • Date
    • Thread