Re: LSP Was: Mixing OO and DB

From: Daniel T. <daniel_t_at_earthlink.net>
Date: Thu, 21 Feb 2008 19:01:22 -0500
Message-ID: <daniel_t-75EBA5.19012221022008_at_earthlink.vsrv-sjc.supernews.net>


Robert Martin <unclebob_at_objectmentor.com> wrote:
> On 2008-02-20 09:16:17 -0600, S Perryman <q_at_q.com> said:
>
> > > S is any and every subtype of T. S' is in the class of S.
> > > Remember, Liskov's rule was an attempt to define what S was. In
> > > essense she said that subtypes are those things that are
> > > substitutable.
> >
> > No.
> > Liskov and Wing define their subtype predicate in a specific way,
> > using a substitutability predicate. The latter predicate they
> > also define very precisely.
>
> Maybe I'm missing something. The principle has been around for a
> long time. The old quote from the May, 1988 Sigplan Notices was:
>
> "What is wanted here is something like the following substitution
> property: If for each object o1 of type S there is an object o2 of
> type T such that for all programs P deŽned in terms of T, the
> behavior of P is unchanged when o1 is substituted for o2 then S is
> a subtype of T."
>
> Are you referring to something else?

I haven't followed the other thread so I'm not sure how relevant my comments may be... Liskov did provide a contract system (as in DBC) as a metric to determine substitutability, could that be the "substitutability predicate" that Mr. Perryman is talking about? Received on Fri Feb 22 2008 - 01:01:22 CET

Original text of this message