Does it make sense to remove slots ?
Massimo Dentico
m.dentico at virgilio.it
Sun Nov 7 21:59:11 PST 2004
Todd Fleming wrote:
> Massimo Dentico wrote:
>
>> http://www.dbdebunk.com/page/page/626998.htm
>
>
> Nice article. Like the rest of their site, I agree with some points he
> makes and disagree with others. (I agree with articles on his site that
> say that SQL NULL is incompatible with the relational model). Here are
> some choice quotes:
>
> "In THE THIRD MANIFESTO, Hugh Darwen and I demonstrate clearly--and I
> think conclusively -- that if your inheritance model involves "pointers
> or references," then it's logically impossible to deal properly with the
> idea that a circle is an ellipse! In fact, we strongly suspect that
> it's this fact (the fact, that is, that pointers and a good model of
> inheritance are fundamentally incompatible) that's the root of the problem."
Now I remember why they forbid pointers in their model;
assume that (informal for brevity):
Ellipse is a type, defined early.
Ellipse has a method ScaleXBy(s), which scale the X axis by the value s.
type Circle: subtype(Ellipse) // Circle is a type, a subtype of Ellipse
var e: Ellipse // e is a variable of type Ellipse
var c: Circle // c is a variable of type Circle
c.Init(10) // c is a Circle of radius 10
You can usually write:
e <- c // assign c to e
Now, if this means "the value of c is copied in e"
there are no problems: the variable e now contains
a value of type Circle which is a proper subtype
of Ellipse.
But if it means "e now points to the same value
pointed by c" you are in trouble as soon as you
write this:
e.ScaleXBy(2)
Now e is pointing to a value of type Ellipse,
so this statement is correct...
... but c is pointing to a value of type Ellipse
also, which is NOT correct!
So this statement is at the same time correct
and incorrect: an absurdity.
Going back to your example, which is different;
in that case they call your "squish" (my "ScaleXBy")
a *mutator* and they wrote:
http://www.dbdebunk.com/page/page/626958.htm
Liskov and Wing tacitly seem to support unconditional
inheritance of mutators, but they never discuss--in fact,
they don't even mention--the logical absurdities that
are necessary consequences of such unconditional
inheritance.
So, as I understood it, in their model such mutator
is NOT inherited.
But if you wrote "squish" in a way such that it returns
an Ellipse, without updating the object, then it is
an *observer* and so there are no problems in inheriting
it.
Again, this is *my* understanding and I could be wrong.
Regards.
--
Massimo Dentico
More information about the Slate
mailing list