• 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: Itrat Khan <email@hidden>
  • Date: Wed, 10 Jul 2002 13:36:35 -0400

On Wednesday, July 10, 2002, at 03:21 AM, 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.

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.


Firstly, I'd say don't worry too much about the perfect way to approach this and do whatever feels right for now; you can fix it later when you've learned more from experience.

Given that this is not an NSDocument-based app, your data source probably has a lot of logic for getting and setting data, so consider making it an NSObject subclass rather than part of the AppController. This should make your controller class much more manageable. Also, having conditional statements to handle delegate requests is not necessarily bad, but if your delegate implementations are doing a lot of work, it may be better to make them NSObject subclasses as well. You can then send delegate messages directly to those instances, bypassing the need for conditional statements.

One piece of advice is to take a look at your interface and see if it really needs that much complexity. You may find it becomes more manageable (for you and the user) if you split the interface across multiple windows or use various forms of progressive disclosure.

Itrat.

............................................................
Modeless Software, Inc.
London, Ontario (Canada)
Tel: +1 519 473 2037
Web: www.modeless.com
_______________________________________________
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: Plists and booleans
  • Next by Date: Re: Getting info about users on the system
  • Previous by thread: Re: Application architecture question
  • Next by thread: Re: Application architecture question
  • Index(es):
    • Date
    • Thread