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.

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.

Indicating Interface Inheritance

A dashed line with an arrowhead indicates an interface, which is discussed in ...

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