5.6.1 Class Diagrams

5.6.1.1 Class

A class is shown as a box with a title (the name of the class) and an optional list of local attributes, operations and classes. The two class symbols shown below are actually two different views on the same class (Reservation). The left symbol showing only the names of the attributes and the right symbol showing full type information of the attributes. In the following examples one or the other view will be used depending on the illustrative purposes of the example.

[2kb 335x100 GIF]

5.6.1.2 Aggregation

Aggregation is shown as a line connecting two class symbols. A diamond is attached to one end of the line. The diamond is attached to the class that is the aggregate.

[1kb 401x26 GIF]

Multiplicities are shown at each end of the aggregation. Multiplicities may either by an integer value or an integer interval on the form lower-bound...upper-bound. In addition, the star character (*) may be used for upper-bound, denoting an unlimited upper bound. In the above example the multiplicities mean that an office may contain zero or more letters.

The diamond attached to the aggregate may either be hollow or filled. If it is hollow the implementation of the aggregation is said to be by-reference and if it is filled it is said to be by-value. The first case corresponds to reference composition in BETA, the second to whole-part composition.

[2kb 440x43 GIF]

5.6.1.3 Specialization

Specialization is illustrated as a tree of class symbols. A line is drawn between the subclass and the superclass with an arrow at the end connected to the superclass.

[2kb 362x137 GIF]

5.6.1.4 Association

An association is shown as a line connecting two class symbols.

[2kb 539x108 GIF]

Multiplicities are shown on each end of the association. The syntax of the multiplicities on associations is exactly the same as the syntax of the multiplicities on aggregations. In the above example the multiplicities mean that a company may be associated to zero or more persons through the relation works-for and a person is related to exactly one company (i.e. in this example a person may not have more than one employer).

Apart from multiplicities role names may be attached to each end of the association. A role name indicates the role played by the class attached to the end of the line near the role. For instance in the above example the role of a company seen from the view of a person is an employer (and vice versa).

Finally the association may be given a name. In the above example the name of the association is WorksFor.


Mjolner Integrated Development Tool - Tutorial
© 1991-2004 Mjølner Informatics
[Modified: Friday October 27th 2000 at 14:56]