On Tue, May 20, 2008 at 4:07 PM, Peter Duniho <[EMAIL PROTECTED]> wrote:
> But personally, it makes me nervous to have a language that allows the
> implementation of a class to change according to other code not related to
> the class.  It's one thing if you're just adding a method that you want to
> use somewhere else.  But in Objective-C you can also add a method that
> overrides a base class method, or would not normally exist in the class but
> which has meaning to some other code that might check for it.

I'd just like to point out that the above applies to any OO language
which supports both subclassing and dynamic dispatch, which is to say
approximately all of them. Categories are certainly differently
powerful in this regard, and as such will get you into trouble in ways
that subclassing cannot, but subclassing already has this powerful and
dangerous semantic that you're worried about. (And I think you're
rightfully nervous, it's just that you can't get away from it by
banishing categories.)

One of the things I enjoy about Cocoa is how it tends to discourage
subclassing. Most common customizations can be done through delegates
or notifications which helps reduce the danger of subclassing.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to