CHAPTER 10Fairy Tales

Polymorphism is the subject of this chapter. No, it's not some kind of New Age religion; it's about using the same message (or command) in order to get the same result, but for different kinds of objects. Let's look at a simple example. Figure 10-1 shows the use of the command draw() for three different geometric shapes: a square, a triangle, and a circle.

image

Figure 10-1. An example of polymorphic command use with different objects

Although the three geometric shapes in Figure 10-1 are different objects, using the same command, you can communicate what you want each object to do, and the object knows how to do it.

The polymorphic ...

Get Beginning PL/SQL: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.