Re: Clean Object Class Design -- Circle/Ellipse

From: Dmitry Kazakov <dmitry_at_elros.cbb-automation.de>
Date: Mon, 20 Aug 2001 11:04:35 GMT
Message-ID: <3b80eb49.12371156_at_news.cis.dfn.de>


On 18 Aug 2001 08:20:24 GMT, mmeijeri_at_xs4all.nl (Martijn Meijering) wrote:

>The intuitive meaning many people seem to be using for subtype is simply
>subset. My point is that that is only one (the simplest) of many possible
>definitions. Subtype isn't a natural phenomenon, it's a matter of
>definition. What I'm interested in is which definition is the most useful,
>perhaps depending on the circumstances.

How about this:

  1. S is an in-subtype of T, iff there is a defined conversion S->T, i.e. there is a mapping g:DS->DT, where DS, DT are the domain sets of S and T respectively.

In-inheritance. For any in-method f:DT->0 there is f':DS->0 defined as a composition f'=f o g

2. S is an out-subtype of T, iff there is a defined conversion T->S: h:DT->DS.

Out-inheritance. For any out-method f:0->DT there is f':0->DS defined as f'=h o f

3. S is an inout-subtype of T, iff it is an in-subtype and an out-subtype.

Inout-inheritance. For any inout-method f:DT->DT, there is f':DS->DS and f'=h o f o g

Regards,
Dmitry Kazakov Received on Mon Aug 20 2001 - 13:04:35 CEST

Original text of this message