Does it make sense to remove slots ?
Tim Moore
Timothy at Moore.name
Sun Nov 7 13:40:18 PST 2004
On Nov 7, 2004, at 4:25 PM, Peter van Rooijen wrote:
> Tim Moore 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.
>
> Hi!
>
> While I agree that shape-mutable circles may make little sense being
> implemented as subclasses of ellipse, I would add that LSP is a vision
> on subtyping, not on inheritance/subclassing.
>
> Inheritance/subclassing is just what it is. The language that is your
> context defines how inheritance works and what it means. There is no
> reason to limit its use to the implementation of subtypes.
>
>
That is a good point, but in this case the question boils down to: why
do you want to make Circle derive from Ellipse at all? Is it to inherit
behavior? I think for most people, it is just because they know that
geometrically a circle is a kind of ellipse, so they feel it should be
a subtype.
--
Tim Moore
More information about the Slate
mailing list