Does it make sense to remove slots ?

Massimo Dentico m.dentico at virgilio.it
Sun Nov 7 13:56:07 PST 2004


"Tim Moore" <Timothy at Moore.name> wrote:

> That's a pretty well-accepted object oriented design philosophy known 
> as Liskov's Substitution Principle. It's actually often phrased in 
> terms of "the circle/elipse problem" as a matter of fact.
> 
> Check out 
> http://www.parashift.com/c++-faq-lite/proper-inheritance.html#faq-21.6
> which as you can see is in a C++ FAQ, but really applies to object 
> oriented design in general.
> 
> Also see http://c2.com/cgi/wiki?LiskovSubstitutionPrinciple for some 
> extended discussion.

Oh.. the sacred dogma, the "Liskov's Substitution Principle".
Unfortunately for the followers some non-followers exist, see
"WHAT DOES SUBSTITUTABILITY REALLY MEAN?", by Chris Date:

  http://www.dbdebunk.com/page/page/626998.htm

 
> Long story short: Todd is right. Circle shouldn't be derived from 
> Ellipse unless they're both immutable, and most likely you don't really 
> need a Circle type at all.

Please, explain what does it mean to mutate a *value*.

A *value* is immutable by definition; what you can mutate
eventually is a *variable*. In the context of a prototype-based
languages as Slate, slots are variables.

Besides this, I agree with Peter van Rooijen: if you decouple
the concept of inheritance/subclassing from that of subtyping
(IIRC as in Sather http://www.icsi.berkeley.edu/~sather/) the
problems vanishes:

- subtyping means:  if A is a subtype of B, then A is a subset of B;
- inheriting means: if A inherit from B, then part/all of the structure
                    and/or behavior of B is *included* in (inherited by) A.


Regards.

--
Massimo Dentico







More information about the Slate mailing list