Different Actions

The fact that the same message may elicit different responses is illustrated by the following example. As we have seen, the message sendFlowers can be given to Flo, my florist, and will yield the desired result.

However, I can send the same message to Beth, my wife. She will accept the message, and the desired outcome will be produced. However, the actions performed by Beth will be different from the actions performed by Flo. So we have the same message, but two different behaviors. The interpretation, that is the actions performed, differ depending upon who the message is given two.

As a third example, if I give the message to Ken my dentist, he will reject the message and issue a run-time error message. So, not all objects will accept all messages.

[audio] 19 [real] 19 Text to accompany slide 19, in Chapter 1 of An Introduction to Object-Oriented Programming