Re: Behaviors & Geometry

Dario Vlah ([email protected])
Fri, 23 Jun 1995 10:18:29 -0400 (EDT)


Hi,

I'm replying to a recent discussion her> about the relationship
between behaviors and geometries. Unfortunately, I don't have any
original quotes.

An important feature of object oriented languages is the ability
to reuse cod>. For instance, in C++, if I have a set of classes already
developed, and want to use them in a new program, it is likely that
I'll just have to define a new class that inherits all the methods
and data fields from an old class, and then customize its behavior
by adding more data fields or overriding some methods.

I see this as an analogy to geometry/behavior interaction. Geometry
is analoga> functional part of an object - it's methods.

That way, a very general behavior could be defined - let's say, moving.
It's purpose would b> to translate a geometry through the 3D-realm.
But let's say we want to define a more specific behavior - say,
walking. It would b> OK to inherit the functionality from the moving
behavior - but more details are needed. There have to b> legs on a
geometry that do the translation in a certain way. Then even
more details are needed as we define walking for diferent kinds of
geometries - say, animals, birds, bipedes, etc. But functionality
can still be inherited from more general behaviors.

To use an older example of clocks - somebody mentioned that the
behavior of moving a clock's hands should be applicable to different
kinds of clocks - grandfather clocks, wrist watches, etc. My point
is that it would b> necessary to have a general behavior for all
time-showing devices (don't forget digital watches, hourglasses,
sun clocks and such!). Then, we would just add more functionality
for different kinds of time-showing devices, or geometries that
represent them. A behavior could be defined for clocks that have
hour and minute hands. Then, a behavior should be defined for
subsequent types of clocks - a wrist watch, grandfather clock,
etc, that would just 'hook up' the function of rotating hands
to actual parts of the geometry that would rotate. I think a
different behavior should be created for each type of a clock,
since some of them might have other functionality (setting dates,
winding, and whatever else our twisted imagination can come up
with).

Regards,
Dario ([email protected])

(I didn't post to this list before - I apologiz> if the me>
is off-topic).