• 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: Category vs Subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Category vs Subclass


  • Subject: Re: Category vs Subclass
  • From: "David P. Henderson" <email@hidden>
  • Date: Thu, 16 Aug 2001 23:37:34 -0400

On Thursday, August 16, 2001, at 01:41 , Finlay Dobbie wrote:

> What about if you need to override a method and provide your own
> implementation? :-)
>
Then you are probably better off subclassing. If you use categories, you
lose access to super. If you are overriding, chances are you will
need/want access to super's implementation to handle the cases you're
uninterested in changing the behavior. Category methods affect all
objects in your project which touch them ie a class implementation
includes the file containing the category. Whereas, with subclass, only
objects of the subclass or its descendants are affected by the
overridden methods. If I haven't explained this problem correctly,
please correct it for the benefit of all.

Dave
--
Chaos Assembly Werks
"The proper office of a friend is to side with you when you are in the
wrong. Nearly anybody will side with you when you are in the right."
- Mark Twain


References: 
 >Re: Category vs Subclass (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: Category vs Subclass
  • Next by Date: Re: [OT] default web browser
  • Previous by thread: Re: Category vs Subclass
  • Next by thread: Re: Category vs Subclass
  • Index(es):
    • Date
    • Thread