Re: [NEWBIE]: Categories, etc vs subclassing
Re: [NEWBIE]: Categories, etc vs subclassing
- Subject: Re: [NEWBIE]: Categories, etc vs subclassing
- From: J Tichenor <email@hidden>
- Date: Thu, 21 Oct 2004 08:24:02 +0100
Thanks everyone. That clears up a lot and confirms much.
On 20-Oct-04, at 8:35 PM, Amar Sagoo wrote:
I think one reason those techniques are often preferred over
subclassing is to reduce dependencies on class structure. If a lot of
classes are "interlocked" in a particular hierarchy, it's harder to
change the design later. A framework like Cocoa that uses a lot of
delegation and categories is more loosely coupled.
Also, one thing you can do with a category that you can't with a
subclass is to add functionality to a whole branch of a class
hierarchy (i.e., to a class and its existing subclasses); Subclassing
can only be used to create new "leaves".
Amar
_______________________________________________
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