• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [NEWBIE]: Categories, etc vs subclassing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: [NEWBIE]: Categories, etc vs subclassing
      • From: Evan Schoenberg <email@hidden>
References: 
 >[NEWBIE]: Categories, etc vs subclassing (From: J Tichenor <email@hidden>)
 >Re: [NEWBIE]: Categories, etc vs subclassing (From: Evan Schoenberg <email@hidden>)

  • Prev by Date: Re: [NEWBIE]: Categories, etc vs subclassing
  • Next by Date: Re: [NEWBIE]: Categories, etc vs subclassing
  • Previous by thread: Re: [NEWBIE]: Categories, etc vs subclassing
  • Next by thread: Re: [NEWBIE]: Categories, etc vs subclassing
  • Index(es):
    • Date
    • Thread