Re: LSP Was: Mixing OO and DB

From: Robert Martin <unclebob_at_objectmentor.com>
Date: Fri, 22 Feb 2008 11:16:57 -0600
Message-ID: <2008022211165795335-unclebob_at_objectmentorcom>


On 2008-02-22 03:37:45 -0600, S Perryman <q_at_q.com> said:

> And for practical demonstration, I can take the apocrypthal Circle/Ellipse
> problem, and show that Circle is not a Liskov/Wing subtype of Ellipse
> without ever needing to see any program that may be using Circle or Ellipse
> types.

To do so you must posit the property of mutability, or some other unsubstitutable property. It is quite possible to describe a Circle and an Ellipse that have substitutable properties.

By extension, if we must take into account every possible property, I think you could make the argument that no two types could ever have a subtype relationship since there will always be some possible property that is not substitutable. Indeed, I'd bet you could construct a Godelian paradox.

-- 
Robert C. Martin (Uncle Bob)  | email: unclebob_at_objectmentor.com
Object Mentor Inc.            | blog:  www.butunclebob.com
The Agile Transition Experts  | web:   www.objectmentor.com
800-338-6716                  |
Received on Fri Feb 22 2008 - 18:16:57 CET

Original text of this message