Re: Can I split an implementation file?
Re: Can I split an implementation file?
- Subject: Re: Can I split an implementation file?
- From: "Michael Ash" <email@hidden>
- Date: Thu, 27 Nov 2008 11:34:31 -0500
On Thu, Nov 27, 2008 at 8:30 AM, Greg Robertson <email@hidden> wrote:
> One of my implementation files is getting kind of long and I would
> like to split it into two.
>
> I have a lot of custom getters and setters and I was wondering if
> there was a way I could put them in a separate file but keep a common
> interface file?
>
> Can I do that?
>
> What is the syntax for doing this?
Others have answered the direct question, I thought I would wander off
into the realm of potentially unwanted advice. If your class is
getting this large, then it may be a sign that your design is becoming
unwieldy and you should actually be splitting it into multiple
classes. Personally I try to keep my classes under 2000 lines whenever
possible, and under 1000 if I can. When I can't avoid them getting
larger, then I try to see if I can split them up nicely. Often when
they become that large, it's because they're doing 2-3 distinct tasks,
and each of those distinct tasks can generally be split into a
separate class.
Anyway, just a thought on design, obviously you don't have to listen. :-)
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden