Re: Outline and Table back to front
Re: Outline and Table back to front
- Subject: Re: Outline and Table back to front
- From: glenn andreas <email@hidden>
- Date: Mon, 20 Jun 2005 14:24:10 -0500
On Jun 20, 2005, at 1:05 PM, Thomas Davie wrote:
On Jun 20, 2005, at 6:59 PM, Bill Bumgarner wrote:
Apple ships a header with the following contents. Therefore, this
is law if you want to be an effective Cocoa programmer.
@interface NSOutlineView : NSTableView
I absolutely agree with you in terms of the implementation we
have... If you read my original post I said NSTableView *should* be
a subclass of NSOutlineView.
Thus expressing the opinion that the implementation is semantically
incorrect.
It's not a point of "quick Apple, go change this" it's a case of
"hang on, there's something not right here, here's an
inconsistency to work around".
No subclass should ever add functionality, because this breaks the
"is a" relationsip... You can't say that a object is a landmass
that adds the ability to do anything else you like... You have to
say a landmass is an object that takes away the ability to do a lot
of things (e.g. float)
Throwing in my small handful of change for another analogy:
A brain surgeon "is a" surgeon, but has additional functionality that
your average surgeon has - they have the functionality required to
perform surgery on the brain.
Looking at the NSTableView vs NSOutlineView, the NSTableView is a
surgeon (it know how to cut stuff into a grid to present to the user)
but doesn't know how to work on the brain (making it a heirarchy with
collapsable rows), which is what NSOutlineView knows how to do
(since NSOutlineView specializes in outlines).
If all surgeons could perform brain surgery, there wouldn't be a
specialization called "brain surgeon" - the average surgeon isn't a
brain surgeon with it's ability to operate on brains removed.
I think you're confusing the term specialization with "adding" or
"removing" functionality - a subclass is a specialization of its
superclass, and while this "removes" potential functionality, it
replaces it by "adding" concrete functionality (an NSObject "could"
store a number or a string, but it doesn't unless it is an NSNumber
or NSString)
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
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