Re: Clean Object Class Design -- Circle/Ellipse

From: Marc Gluch <marc.gluch_at_mindtap.com>
Date: Sat, 18 Aug 2001 21:17:36 GMT
Message-ID: <3b7ed018.3679574648_at_news.grpvine1.tx.home.com>


On 18 Aug 2001 12:22:44 -0700, mikharakiri_at_yahoo.com (Mikito Harakiri) wrote:

>marc.gluch_at_mindtap.com (Marc Gluch) wrote in message news:<3b769e09.3207460634@news.grpvine1.tx.home.com>...
>>
>> Definition 1 (Gluch)
>> S is a subtype of T iff S has all axioms of T plus some additional
>> one(s).
>
>Marc,
>
>According to this definition neither integers is subtype of reals, nor
>the other way, right?
Correct.

> (If we take Peano axiom system for positive
>integers, and compare it with definition of real number system as an
>algebraic structure represented by Dedekind-complete ordered field,
>then it is easy to see that induction axiom doesn't hold for real
>numbers, while multiplicative closure doesnt hold for integers).
>Therefore, could you suggest some examples demonstrating the utility
>of your definition?
Sure, take a look at Smalltalk.
Magnitude provides the default axiomatization of order (<, min, max). Number (derived from Magnitude) provides (partial) axiomatization of standard arithmetic operations (+-*/, quotient, remainder, etc. ), defines other functions, such as sin, cos, log, and defines conversion rules among different concrete subtypes, such as Integer, Fraction, Float. (all derived from Number). Each subclass overrides the operations it needs to for the purpose of ensuring proper semantics.

The directive subtype = subset would send you on a wild goose chase for imaginary relationships (any homomorphism between two sets could be claimed to form a basis for subtyping)

>Also, your definition seems to ignore subtle effects like axiomatic
>incompleteness of the mathematical model (as if we don't have enough
>confusion already;-).

That's a different story. If nothing else, definition 1 sets up a frame of mind oriented toward reusing/factoring specifications and code.

Marc Gluch
Mindtap Inc. Received on Sat Aug 18 2001 - 23:17:36 CEST

Original text of this message