Re: [NEWBIE]: Categories, etc vs subclassing
Re: [NEWBIE]: Categories, etc vs subclassing
- Subject: Re: [NEWBIE]: Categories, etc vs subclassing
- From: j o a r <email@hidden>
- Date: Wed, 20 Oct 2004 10:34:00 +0200
On 2004-10-20, at 10.05, J Tichenor wrote:
But rarely on cocoa-dev are those other methods suggested. Almost
always subclassing is the first way to go.
Just wondered if my readings were wrong, and the other methods of
extension are far more limited than implied, or if subclassing is just
so much a habit?
It might be because it's the tricky questions that end up on the
mailing list, and that they more often require a solution using
subclasses. Just a guess.
I think that it's often more correct to investigate a solution using
delegates, categories or wrapped objects first, before looking into
subclassing.
On 2004-10-20, at 10.20, Evan Schoenberg wrote:
Additionally, you can't mess up things which currently work using
categories, since you can't override methods. On the other hand, you
can't override methods.
Sure you can. The only pit fall with this approach is that you can have
multiple categories overriding the same method, and it's probably
undefined (depending on when they are loaded into the runtime) which
one will take precedence.
j o a r
_______________________________________________
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