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.


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 the O’Reilly learning platform.

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