# LSP paradox

Date: 19 Oct 2006 09:36:31 -0700

Message-ID: <1161275791.717792.220630_at_f16g2000cwb.googlegroups.com>

vc wrote:

*> Jan Hidders wrote:
*

> [...]

*>
**> A much simpler example. Let {0, 1, 2, 3} be a set of four integers
**> with addition modulo 4. Then, none of its subsets, except {0} and
**> {0, 2}, retains the addition mod 4 operation which makes the idea of
**> 'subtype as subset' utterly silly, as it would with respect to just
**> about any common math structure.
**>
**> Also, the OOP hypothetical programmer would expect that a subtype
**> would have, informally speaking, *more*
**> properties/operations/'methods', not less: the basic class properties
**> plus some new ones. So at the intuitive level with typical languages
**> like Java, 'subtype as subset' does not make much sense either, at
**> least with respect to even the simplest mathematical objects.
*

I take Val's side here. There was a similar exchange on LSP paradox free interpretation on comp.object awhile ago. Even the example become to resemble theirs -- octic group with four elements.

I'm not sure what the other participants conclusion came to, but for me the best you can do is to have the same ground set for base class and subclass. The subclass would have more operations. Received on Thu Oct 19 2006 - 18:36:31 CEST