Changing Method Arguments

Equality testing is one place where it frequently seems as if it would be nice if one could change the types of member function arguments. Consider the following class hierarchy. We have a parent class Shape, and two subclasses Triangle and Square. We want to redefine the equality testing method in each. yet wouldn't it be nice if we only needed to be concerned with testing squares against other squares, and triangles against triangles?

The problem here is that we have changed the type signature. The signature in the child classes is no longer the same as the signature in the parent classes.

[audio] [real] Text to accompany slide16, in Chapter 12 of An Introduction to Object-Oriented Programming