Did anyone actually come up with a reasonable example? (a cursory
glance at eiffel docs reveals they don't have a killer example either)
It could be that objects are like coroutines; they need a moderate
amount of complexity for their advantages to become apparent. What's
the object equivalent of samefringe?
Object-orientation lets you have:
- more than one object implementing the same protocol;
- more than one method defined in the same protocol;
- more than one protocol implemented in the same object;
- methods and instance variables defined in different classes in the
ancestry of an object.
An ideal example would show all four of these kinds of variation.
Sketchpad[0] had polymorphism for geometry (drawing and hit testing
[1]) and topological constraints. I'm not sure, but it seems that
instances of his "partly flexible arrow" are examples of objects
which have been constructed so as to have variables and constraints
at different points in their "ancestry". (what role did the
"masters" play wrt to instances? sketchpad may have been more
prototype- than object-oriented)
However, while the implementation was certainly small, I doubt the
concepts are simple enough to serve as an introduction.
-Dave
(I was also amused to note that the cafeteria-tray analogy[2] for a
LIFO data structure predates the now-canonical term "stack")
[0] http://www.guidebookgallery.org/articles/
sketchpadamanmachinegraphicalcommunicationsystem
[1] hit testing with the light pen is pleasingly direct: the pen
triggers an interrupt as each "hit" primitive is drawn. As
Sutherland says in his thesis[3],
the demonstrative input uses the light pen optics as a sort of
analog computer to remove from consideration all but a very few
picture parts which happen to fall within its field of view, saving
considerable program time.
[2] however, the "hen & chickens" have been replaced by "doubly
linked lists" in CS; they've not even survived the intervening half-
century in food service (it's all "chicken" now), and british pub-
names appear to be their last holdouts...
[3] http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-574.pdf
--
To unsubscribe: http://lists.canonical.org/mailman/listinfo/kragen-discuss