On Thu, Nov 6, 2008 at 10:38 AM, Curator1 <rsilvetz / gmail.com> wrote:

> Repeating: Superclasses are based on common conceptual denominators
> (CCD)not on the number of data members.

Agreed.

[following code sample shortened for clarity]
> class ClosedPolygon
> end
>
> class RegularPolygon < ClosedPolygon
> end
>
> class Square < RegularPolygon
> end
>
> class Rectangle < ClosedPolygon  # See!!!  CCD's properly
> end
>
> class Pentagon < RegularPolygon
> end
>
> class IsoTriangle < ClosedPolygon
> end
>
> class EquiTriangle < RegularPolygon
> end

Can we take the principal of common conceptual denominators further by
using modules in addition to superclasses?

class Rectangle < ClosedPolygon
end

class Square < Rectangle
  include RegularPolygon
  def initialize
     super()
     check_sides_are_equal_length #defined in RegularPolygon
end

-Michael Libby