Re: Circles and ellipses
Date: Thu, 23 Aug 2001 10:38:56 +0100
Message-ID: <9m2ic9$avlfc$1_at_ID-75294.news.dfncis.de>
"Bob Badour" <bbadour_at_golden.net> wrote in message news:cd3b3cf.0108220440.fbece3d_at_posting.google.com...
RM> This is the essential problem that the LSP (Liskov Substitution
RM> Principle) tries to resolve; or at least identify.
>If one treats values and variables as the same thing, then LSP
Person = { name : string, age : 0-100 } ;
Employee : Person
salary: 0..N, payroll-id : string
>guarantees that no inheritance is valid unless every subtype is a
>superset of the values of the supertype, but we already know that a
>subtype is a subset of the values of the supertype. This would require
>equivalent sets of values for all types related in any way through
>inheritance.
{
}
Employee is a subtype of Person.
Employee properties are *not* a subset (not a proper one anyway) of
the supertype.
RM> This implies that the "naturalness" of the derivation is not RM> useful.
>I would argue that the lack of distinction between values and
>variables reduces utility -- not the naturalness of the derivation.
>The utility impairment should be a clue that the lack of such
>distinction is harmful.
Plenty of truth in that.
Regards,
Steven Perryman
Received on Thu Aug 23 2001 - 11:38:56 CEST