• 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 Tichenor <email@hidden>
  • Date: Thu, 21 Oct 2004 08:24:02 +0100

Thanks everyone. That clears up a lot and confirms much.

On 20-Oct-04, at 8:35 PM, Amar Sagoo wrote:

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
References: 
 >[NEWBIE]: Categories, etc vs subclassing (From: J Tichenor <email@hidden>)
 >Re: [NEWBIE]: Categories, etc vs subclassing (From: Amar Sagoo <email@hidden>)

  • Prev by Date: Power Night (geeknights) first meeting / planning meeting
  • Next by Date: Re: Metal window pattern color
  • Previous by thread: Re: [NEWBIE]: Categories, etc vs subclassing
  • Next by thread: NSTableView edit problem
  • Index(es):
    • Date
    • Thread