Re: Outline and Table back to front
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