Representing Relationships

Relationships play a key role in capturing and modeling the important structural aspects of a Java application.

Some of these relationships, such as inheritance, can be explicitly identified in the Java language via predefined keywords. Others are not as easily identifiable in Java code but can nonetheless be represented.

Inheritance

The UML concept of generalization is analogous to inheritance in Java. Generalization maps directly to the extends keyword and is shown visually via a line with a triangle at the end nearest the super class. See Figure 4-9.

Figure 4-9. Representing the inheritance relationship

Realization ...

Get Developing Enterprise Java Applications with J2EE™ and UML now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.