Search code examples
propertiesattributeslanguage-lawyerumlclass-diagram

Different notations for attributes and properties of UML classes


UML defines a property to be either an attribute of a classifier, or the member end of an association, or both at the same time. At the same time, an attribute is a property that is owned by a classifier. So the line between the two is very thin. For a class, the usual notation for an attribute is to appear in the attribute compartment of the class:

But The UML 2.5.1 specification allow a graphical notation as well (chapter 9.5.4, page 114):

In a Classifier, an attribute may also be shown using association notation, where only an aggregation adornment (hollow or filled diamond) may be shown at the tail of the arrow.

Shall we understand this clause as meaning, that the association notation for an attribute requires the aggregation notation as follows?

enter image description here

If yes, wouldn't this be confused with an aggregated property? And wouldn't this contradict UML 2.5.1 when it says that there is no semantic for shared aggregation?


Solution

  • No, the sentence tries to define, what can be shown on an association like notation for an attribute. This applies to attributes, that are not at the same time association ends. In absence of an association, there can be no information about the opposite end. Therefore, only adornments that belong to the attribute itself can be shown. Since the aggregation kind is a property of the attribute, it can be shown.