next up previous contents index
Next: 13.4 Inheritance Up: 13. Object Oriented Computing Previous: 13.2 Objects and Encapsulation


13.3 Short Introduction to the UML

In Sect. 13.1.2 we have mentioned the UML. This is a modelling language based on a set of diagrams describing various aspects of the problem solved:

We will use only class diagrams in this article.

The class in the class diagram is presented as a rectangle containing the name of the class. It usually contains also the names of the methods and the names of the attributes; both may be prefixed by symbols representing their access specification (the $ {+}$ sign for public members, the $ {-}$ sign for private members and the $ {\char93 }$ for protected ones). The name, the attributes and the methods are in the class icon separated by horizontal lines. If not necessary, attributes and methods may be omitted. Figure 13.1 shows the icon of the Source class as we have designed it in Sect. 13.2.4.

Figure 13.1: The full UML icon of the Source class
\includegraphics[width=3.1cm]{text/2-13/Vir01.eps}

Associations (i.e., any relations) among classes in UML class diagrams are represented by lines connecting the class icons ended by arrows; as a description, the multiplicity of the relation may be given. For example, the number appended to the line connecting the Source and the Particle classes in Fig. 13.2 express the fact that one particle source may emit any number of particles. The number appended to the line connecting the Source and the Generator class express the fact that one source uses only one random number generator.

Object composition is expressed by the arrow ending with a filled diamond. Fig. 13.2 shows relations among the Source, Particle, and Generator classes. Simplified class icons are used.

Figure 13.2: Relations among the Source, Particle and Generator classes
\includegraphics[width=9.5cm]{text/2-13/Vir02.eps}


next up previous contents index
Next: 13.4 Inheritance Up: 13. Object Oriented Computing Previous: 13.2 Objects and Encapsulation