in reply to Re^2: The Accessor Heresy
in thread The Accessor Heresy

Square isa Rectangle isa Polygon

Not quite. Square is both a Rectangle and a Rhombus, both of which are Parallelograms which isa Quadrilateral which isa Polygon. In addition, Square->is_regular_polygon() is true where none of the other classes mentioned in this listing can make that claim. is_regular_polygon() would be a method of Polygon.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^4: The Accessor Heresy
by Anonymous Monk on Nov 28, 2005 at 21:30 UTC
    Sure. I'm no great fan of object hierarchies (nor am I very good at them); I was just pointing out that it wasn't hard to come up with examples where the base classes were more generic and complicated than the specific instances that derived from them.
    --
    Ytrew