Re: LSP Was: Mixing OO and DB

From: Daniel T. <daniel_t_at_earthlink.net>
Date: Sat, 23 Feb 2008 11:32:35 -0500
Message-ID: <daniel_t-3ADD05.11323523022008_at_earthlink.vsrv-sjc.supernews.net>


In article <LSP-20080223152438_at_ram.dialup.fu-berlin.de>,  ram_at_zedat.fu-berlin.de (Stefan Ram) wrote:

> Robert Martin <unclebob_at_objectmentor.com> writes:
> >Maybe I'm missing something. The principle has been around for a long
> >time. The old quote from the May, 1988 Sigplan Notices was:
>
> There, it is being attributed to a »forthcoming« work of Leavens:
>
> Gary T. Leavens, Verifying Object-Oriented Programs that
> use Subtypes. Massachusetts Institute of Technology,
> Laboratory for Computer Science, Technical Report TR-439,
> February 1989.
>
> Barabara Liskov in a later work has used simpler wording to
> explain the meaning of »subtype« (without quantifiers).
>
> I do not apreciate the original »LSP« that much, because it
> lacks explicit reference to specification (contract).

She wrote her behavioral sub-typing at least three times that I know of, and in every one she gives an example of how to specify a contract and shows how to use the contract to determine substitutability.

I'm not sure what you mean by the above.

> I would prefer the following criterion (in my own wording):
>
> »B is a subtype of P, when it fulfill P's specification.«

That would be begging the question. Liskov's paper has a natural progression, she starts with the problem, then specifies what is needed to solve the problem (the oft quoted phrase,) then shows how to use contracts to solve it.

I think the phrase that is often quoted from the Liskov papers is unfortunate because it says nothing of *her* solution to the problem. A better quote from her '99 paper is:

   "the subtype ought to preserve any properties that can be proved    about the supertype."

But that isn't even enough, because she isn't referring to every possible property that can be proved about the supertype, only the behavioral properties. This makes sense considering OO is about behavioral properties. Received on Sat Feb 23 2008 - 17:32:35 CET

Original text of this message