Representing Structure

Structural concepts, such as class and interface, are fundamental to both Java and the UML. This section identifies how these concepts map to Java and the UML.


In the UML, a Java class is represented via a compartmentalized rectangle. Three horizontal compartments are used:

  • Name compartment: Shows the Java class name

  • Attribute compartment: Lists variables defined on the class, if any

  • Operations compartment: Shows methods defined on the class, if any

Figure 4-1 shows a simple Java class without any variables and methods.

Figure 4-1. A class in Java and the UML

An abstract class is identified by italicizing the class name. ...

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.