Re: Clean Object Class Design -- Circle/Ellipse

From: Bob Badour <bbadour_at_golden.net>
Date: Sat, 18 Aug 2001 11:57:25 -0400
Message-ID: <unwf7.56$Ao.16706689_at_radon.golden.net>


>The (interesting) question is not "can you model it this way or
>another" , but rather "what is the utility of each model".
>Btw, consistency is a prerequisite for utility.

I find it intersting that you should say that given your wont to use inconsistent semantics for multiply and divide as defined for real numbers when you apply those operators to the subset of real numbers that are integers.

>Attempts to define types as domains (sets) may yield satisfactory
>results in the database world (duh), but they break down when extended
>to functional and algebraic types.

Not if you accept your own requirement for consistency:

Real operator/(Real r1,Real r2); // Operates on Reals Integer operator/(Real r3,Real r4); // Also operates on Reals Integer operator/(Integer i1,Integer i2); // Does not operate on Reals

One can assign an integer value to any of r1, r2, r3, r4 without inconsistency.

>The only "fool-proof" way of deciding if A is a subtype of B,
>that I know, is to treat A and B as formal theories.
>
>The first questions to consider would be:
>Are A and B consistent?
>Does one make more assumptions (postulate more axioms) than the other?

Are you arguing that every subtype must postulate more axioms than its supertype does? If so, I tend to agree. If not, can you think of any subtype that does not?

>Finally the utility question; can elements of A be substituted for
>elements of B without breaking the theory of B?

Are you arguing that one cannot substitute integer values for real values. Does this mean that one cannot evaluate (2 * pi) because 2 is an integer value? If so, how do we relate a circle's radius to its circumference?

>Also, note that there is no single right way (whether it's Date's way
>or not) ) to model the "real world".
>Both set theory and lambda calculus can be used as foundations for
>mathematics, but each approach will make different things easier
>(or harder) to prove.

While I do not want to speak for anyone else, I think you will find that many people consider both set theory and lambda calculus simply part of the real world -- just as the value 1 is part of the real world. Received on Sat Aug 18 2001 - 17:57:25 CEST

Original text of this message