Re: Outline and Table back to front
Re: Outline and Table back to front
- Subject: Re: Outline and Table back to front
- From: Thomas Davie <email@hidden>
- Date: Mon, 20 Jun 2005 20:17:31 +0100
On Jun 20, 2005, at 7:47 PM, Andreas Mayer wrote:
Am 20.06.2005 um 20:05 Uhr schrieb Thomas Davie:
No subclass should ever add functionality, because this breaks the
"is a" relationsip...
I'm sorry, but this is utter - um... - nonsense.
Subclasses *refine* the descriptions of their superclasses. They
always do so by *adding* functionality.
A such refined class usually restricts the set of objects that
adheres to the class, because those objects need to be able to
understand *more* messages than objects of the superclass.
NSOutlineView being a subclass of NSTableView is a perfect example.
And, of course, an outline view *is* a table view. It has rows and
columns. But a table view is *not* an outline view, since it can't
collapse it's rows.
okay... Wy last message appears not to be appearing on the list...
But there is a flaw in what you are saying.
Something is a specialisation (or refinement as you call it) if it
restricts the set of objects that are included - this is what you said.
All objects that organise items in rows and columns are examples of
outline views (even those that don't have any branch nodes)
Only those that have no branch nodes are table views
Thus by your own logic, TableView should be a subclass of OutlineView.
Your last statement is flawed, you are saying:
Rectangles are squares because they have four edges
Squares are not rectangles because they don't allow you to have
different lenghts of edges.
This is clearly false
Bob
_______________________________________________
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