Re: [NEWBIE]: Categories, etc vs subclassing
Re: [NEWBIE]: Categories, etc vs subclassing
- Subject: Re: [NEWBIE]: Categories, etc vs subclassing
- From: Amar Sagoo <email@hidden>
- Date: Wed, 20 Oct 2004 20:35:37 +0100
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