[sclug] like a wheel within a wheel ...

Graham cascade.information at gmail.com
Thu Jul 25 19:05:16 UTC 2013


At the scluug meeting, the OOP question was: circle - oval - subclass ...
At the time, I thought a circle was a subclass of an oval. (because it is),
I no-longer think this (because it isnt).

In programming OOP, common themes are:
The derived class is still a respectable base class (an instance of ... is ...)
The base class may be virtual, without any standalone instance
The base class is more of a genre.
The derived class is more specialised.
The derived class has more data attributes *** CLUE ***
(these can be real fields now, or ones that you have to provide later)
The derived class can change or remove behavior.

My new thinking is that the old thinking was wrong:
OLD - a circle is a form of oval - where H==W (ratio == 1.0)
NEW - an oval is a form of circle - stretched so that H == W * ratio
(preferably non-zero ratio)
OR NEW - both are sibling peers, derived from CIRCULAR, derived from SHAPE

In OOP, The derived class has more data attributes ***
This is what makes me more sure that I was upside down.
Moving from circle to based-on-circle, adds a parameter field.
The oval adds ratio = height/width
a concept that circle has defined as a fixed 1.0 or absent.

The second concept, that convinces me, that circle is the base concept,
(OOP says so, but OOP is not necessarily real life),
is that elliptical orbits are fundamentally circle based.
There is an essence of constancy in both.
There is an essence of curve-shape, in both (not in non-circular shapes)
Make two lists of curves, circular, non circular. Its fundamental.

curve: exponents
curve: gaussian probability curves
curve: pendulum
curve: circles
curve: ovals
curve: elipses
curve: sin/cos/tan (circle in action, viewed sideways)
curve: spiral
curve: fibonacci sequence in flowers (almost smooth curve)
curve: r*r can appear in other equations
curve: ...

maybe there is multiple inheritance, or affine transformations,
or build a new shape out of, (not as in spoon from metal?)
or other derived-from-via-transformation-effect

To my mind, there is a unit square that is the root of rectangles,
and a unit circle, that is the root of ovals, and spirals too.

Graham



More information about the Sclug mailing list