Re: Clean Object Class Design -- Circle/Ellipse

From: Bob Badour <bbadour_at_golden.net>
Date: 6 Oct 2001 15:13:47 -0700
Message-ID: <cd3b3cf.0110061413.628f21c_at_posting.google.com>


Graham Perkins <gperkins_at_dmu.ac.uk> wrote in message news:<3BB8485E.41A7EE55_at_dmu.ac.uk>...
> Bob Badour wrote:
> > I find it very telling that almost every OO pundit has found it necessary to
> > write an apologia explaining why the very real and natural subtype/supertype
> > relationship between circle and ellipse does not apply in OO.
>
> But it does apply. If we model the *mathematical* concept of an
> ellipse as an Ellipse class in OO, then there is no problem whatsoever
> doing the same with Circle, and preserving the *mathematical* sub-type
> relation as an OOP subclass relation. The very real and natural
> subtype/supertype relationship between circle and ellipse does indeed
> apply in OO.
>
> Where things go wrong is when people try to add the notion of
> procedural state.

IE. When people confuse values and variables as I have been saying. Variables have procedural state, while values do not. In fact, the instantaneous value of a variable determines its state.

The solution is very simple: Properly distinguish between value and variable.

> The Circle/Ellipse issue is nothing more than a coincidence. Circles
> and Ellipses are simple enough for anyone to get an intuitive grasp
> of. This misleads them into thinking that they understand the maths,
> or that they understand the OOP, or that they understand both. Worse
> still, it misleads them into thinking they understand the connection
> (or lack thereof) between the OOP and the maths.
>
> Most OOP areas we work with don't have coincidences of terminology
> with simple maths, so we don't get fooled into thinking we're dealing
> with simple mathematical models.

Simple mathematicals examples clearly demonstrate a single issue while complex somewhat arbitrary examples obfuscate issues in the interplay. Once one understands issues in isolation, one can better grasp the interplay among issues.

> -----------------
>
> I find it very telling that almost every OO critic has found
> it necessary to attack OO on the basis that its modelling of
> procedural, mutable state does not work exactly like the simple
> mathematics of functional values.
>
> ------------------

What OO critic? Can you point to a single instance of an OO critic attacking OO on the basis of poor handling of procedural, mutable state? I have yet to see such an attack.

As an experienced object oriented programmer, I hardly count as a critic. In fact, I have maintained all along that the relational model is object oriented. Can you fault me for trying to gain a better, more precise, more rigorous understanding of essential OO?

Any criticisms I have seen about OO revolve around the nebulous, ill-defined, arbitrary, confused hodge-podge of differing opinions on what actually constitutes OO. None of which has anything particular to do with procedural, mutable state. Received on Sun Oct 07 2001 - 00:13:47 CEST

Original text of this message