• 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: Categories to help with organization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Categories to help with organization


  • Subject: Re: Categories to help with organization
  • From: Paul Lynch <email@hidden>
  • Date: Fri, 8 Sep 2006 17:47:07 +0100


On 8 Sep 2006, at 16:54, Kamrin Dahlin wrote:

I am fairly new to Cocoa/Obj-C (I have come over from Java), but one of the things I am noticing is that my main Controller class (MyDocument, or similar) tends to get rather large, especially when I start adding in methods for observing, window controls, private methods, overrides etc...

I was wondering if it is a good idea to use categories on the main controller to separate out these different parts of my main controller? Seems like this will help with organization and make my code easier to read by others?

You can do this, if you want. But it is generally better strategy to create smaller controllers; try to think of opportunities to do this - one for one delegate, one for another, a data source, etc. Categories are a perfectly valid way of doing this. If you are working with Core Data, you will find the organisation of controllers follows this approach, and makes it easier for you to do the same.


Paul
_______________________________________________
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


References: 
 >Categories to help with organization (From: "Kamrin Dahlin" <email@hidden>)

  • Prev by Date: Re: Tracking rectangles and bezier paths
  • Next by Date: Re: NSPopupButton
  • Previous by thread: Categories to help with organization
  • Next by thread: addCursorRect:cursor
  • Index(es):
    • Date
    • Thread