Re: Categories to help with organization
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