Java Reference
In-Depth Information
540
Figure 6
UML Notation for Inheritance and Aggregation
In this topic, we use the UML notation for class diagrams. You have already seen
many examples of the UML notation for inheritanceȌan arrow with an open triangle
pointing to the superclass. In the UML notation, aggregation is denoted by a solid line
with a diamond-shaped symbol next to the aggregating class. Figure 6 shows a class
diagram with an inheritance and an aggregation relationship.
The aggregation relationship is related to the dependency relationship, which you saw
in Chapter 8 . Recall that a class depends on another if one of its methods uses an
object of the other class in some way.
Dependency is another name for the Ȓusesȓ relationship.
For example, many of our applications depend on the Scanner class, because they
use a Scanner object to read input.
Search WWH ::




Custom Search