Inheritance

To understand how inheritance is represented, consider the Dog example presented in Chapter 7, “Mastering Inheritance and Composition.” In this example, the class GoldenRetriever inherits from the class Dog, as shown in Figure 10.2. This relationship is represented in UML by a line with an arrowhead pointing in the direction of the parent or superclass.

Image

Figure 10.2. UML diagram of the Dog hierarchy.

The notation is straightforward, and when the line with the arrowhead is encountered, an inheritance relationship is indicated.

Get The Object-Oriented Thought Process, Fourth Edition 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.