Re: LSP Was: Mixing OO and DB
Date: Sat, 23 Feb 2008 16:34:38 -0400
Message-ID: <47c08360$0$4067$9a566e8b_at_news.aliant.net>
Stefan Ram wrote:
> ram_at_zedat.fu-berlin.de (Stefan Ram) writes:
>
>>I would prefer the following criterion (in my own wording): >>»B is a subtype of P, when it fulfill P's specification.«
>
> I would like to add a rewording of this, which will allow me
> to apply the /same/ criterion to both primitive types and
> operational types:
>
> »An entity of a subtype fulfills all constraints fulfilled
> by entities of the supertype of this subtype. An entity of a
> /proper/ subtype also fulfills additional constraints.«
That seems rather similar to "Specialization by Constraint".
> Application to primitive types (sets of values):
>
> {0,1} is a proper subtype of {0,1,2,3}.
> The entities of the supertype fulfill the constraint »0 <= x < 4«.
> The entites of the subtype fulfill this and the additional
> constraint »x < 2«, so it is a proper subtype.
In that case, any proper subset is a proper subtype just by application of the containment constraint for the proper subset. I am not sure that's what you intended.
I suggest a proper subtype has both a proper subset of values and a proper superset of operations.
[useless java example snipped] Received on Sat Feb 23 2008 - 21:34:38 CET