• 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: Outline and Table back to front
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Outline and Table back to front


  • Subject: Re: Outline and Table back to front
  • From: Andy Lee <email@hidden>
  • Date: Mon, 20 Jun 2005 14:21:59 -0400

On Jun 20, 2005, at 2:05 PM, Thomas Davie wrote:
No subclass should ever add functionality,

If the superclass can already do everything, why have subclasses at all?

because this breaks the "is a" relationsip...

I think this is kind of a silly debate over semantics -- which I'm now about to join...


"Adding" and "subtracting" isn't the right way to think about it. A subclass *specializes* its superclass. "Specializing" can mean "adding" the ability to perform certain kinds of calculations, or store certain kinds of data (via a little thing called ivars), or respond differently to method requests than the superclass does, or impose certain invariants (like a square is a rectangle with the invariant that width == height).

There are cases where you could argue either way for which is the superclass and which is the subclass -- or whether there should have been a third base class that they both should have inherited from.

I think it's at least a reasonable solution that NSOutlineView inherits from NSTableView. I think it's a little weird, though, to say "No subclass should ever add functionality."

--Andy

_______________________________________________
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: Outline and Table back to front
      • From: Thomas Davie <email@hidden>
References: 
 >Re: Outline and Table back to front (From: Gorazd Krosl <email@hidden>)
 >Re: Outline and Table back to front (From: Thomas Davie <email@hidden>)
 >Re: Outline and Table back to front (From: Jesus De Meyer <email@hidden>)
 >Re: Outline and Table back to front (From: Thomas Davie <email@hidden>)
 >Re: Outline and Table back to front (From: Corbin Dunn <email@hidden>)
 >Re: Outline and Table back to front (From: Thomas Davie <email@hidden>)
 >Re: Outline and Table back to front (From: Bill Bumgarner <email@hidden>)
 >Re: Outline and Table back to front (From: Thomas Davie <email@hidden>)

  • Prev by Date: Re: Methods calling C functions
  • Next by Date: Modal dialog pauses WebView rendering
  • Previous by thread: Re: Outline and Table back to front
  • Next by thread: Re: Outline and Table back to front
  • Index(es):
    • Date
    • Thread