20 ASAM MCD-2D (ODX) Version 2.2
6 INTRODUCTION TO AND USE OF THE UNIFIED MODELING
LANGUAGE (UML)
6.1 GENERAL ASPECTS
The Unified Modeling Language (UML) is used to define the ODX data model formally and
unambiguously. It enhances readability by graphical data model diagrams.
A short introduction to UML is given in this section. Only those aspects of UML are
described that are used in the ODX data model. Specifically, from the large set of
available UML diagrams, we only apply class diagrams for data modeling.
6.2 CLASS DIAGRAMS
6.2.1 CLASS
The central modeling element in UML is a class. A class represents a set of similar
objects. Generally, a class can be instantiated many times. Every instance of a class is
called an object. A class has attributes (defining the properties of these objects) and
methods (defining the actions an object can perform). For ODX methods are irrelevant
and are not used.
Figure 6 — UML representation of Class
Figure 6 shows the representation of a class and its attributes in UML notation. A class is
symbolized by a rectangle having up to three fields. The top field contains the name of the
class, e.g. PERSON. The second field contains the attributes of the class, e.g. NAME,
AGE, PROFESSION, and ID. Methods are defined in an optional third field. The attribute
field is not always displayed in the ODX data model diagrams. Since the method-field is
unused in the ODX data model, it is never displayed.
Attributes consist of the attribute name, e.g. NAME, followed by the attribute’s cardinality,
e.g. [1] or [0...1] and the attribute type, e.g. String. Furthermore, a default value for the
attribute may be specified. Such a default value follows the type descriptor of the attribute
and is separated from it by the symbol "=".
UML attributes specified with the <<attr>> stereotype in front of their name are
implemented as XML attributes of XML elements. UML attributes without this stereotype
are implement as XML sub-elements of XML elements.
Throughout the ODX data model, class names and attribute names are written in capital
letters.
6.2.2 INHERITANCE RELATIONSHIPS
Classes can inherit attributes from other classes. In Figure 7, a new class SCHOOLKID is
derived from the class PERSON. This means that implicitly the class SCHOOLKID has all
the same attributes as PERSON plus those that are defined specifically for the new class
SCHOOLKID, e.g. GRADE. PERSON is called the parent or super class; SCHOOLKID is
called the child or subclass of the inheritance relationship. Because the subclass adds
more detail to the super class and is thus more specific, inheritance relationships are often
called “specializations”.