Object Responsibility, Page 2 A Description of Polymorphism Many
people consider polymorphism the cornerstone of O-O design.
Designing a class for the purpose of creating totally
independent objects is what O-O is all about. In a well-designed
system, an object should be able to answer all the important
questions about itself. As we have seen, an object should be
responsible for itself. This independence is one of the primary
mechanisms of code reuse. As stated in earlier columns,
polymorphism literally means many shapes—which makes using a
Shape example seem appropriate. When a message is sent to an
object, the object must have a method defined to respond to that
message. In an inheritance hierarchy, all subclasses inherit the
interfaces from their superclass. However, because each subclass
is a separate entity, each might require a separate response to
the same message. As an example, consider the class mentioned in
the previous section, called Shape. This class has a behavior
called draw( ). In this descri