Zinovy Diskin and Juergen Dingel
Kingston, Ontario, Canada
: Towards formal
semantics for associations in UML 2
The UML 2.0 Semantics Project
Any UML model of practical interest is built upon the structural base
specified by class diagrams. The latter are graphs of classes
are glue that integrate classes into a system” (Jim
Metamodeling is based on class diagrams, thence, on
Hence, semantics of the association construct should be clear and
precise. Does UML2 specification meet these requirements?
UML2 Spec defines associations in sect.7.3.3.
sentence of sect. 7.3.3:
An association describes a set of tuples
whose values refer to typed instances
An instance of an association is
called a link.
An association specifies a semantic relationship that
can occur between typed instances. It has at least two ends represented by
properties, each of which is connected to the type of the end. More than one
end of the association may have the same type. An end property of an
association that is owned by an end class or that is a navigable owned end
of the association indicates that the association is navigable from the
opposite ends, otherwise the association is not navigable from the opposite
section. For an association with N ends, choose any N
ends and associate specific instances with those ends. Then the
collection of links of the association that refer to these specific
instances will identify a collection of instances at the other end. The
multiplicity of the association end constrains the size of this
UML metamodel of Associations
UML2 metamodel of Association, processed
There are some things so serious you
have to laugh at them.
A model of the Association Problem…
…and a model of solution: Consider an appropriate
model and different views to it
Three views of the model
The goal is
to build a formal framework where the complex notion of association
can be disassembled into elementary blocks;
compose from these blocks a few constructs that can formally model
different aspects of associations as described and used in the Spec;
check the UML metamodel of association against our formal
framework (Does it fit in? And if not, then fix it by either pressing it
through, or expanding it over, or both :)
Three views of association
PL & UML
DB & UML
Lewis Carroll about UML Associations:
use a word,' Humpty Dumpty said, in a rather
scornful tone,' it means just what I choose it to mean, neither
more nor less.'
'The question is,' said Alice, 'whether you
mean so many different things.'
'The question is,' said Humpty Dumpty, 'which is to be
'When I make a word do a lot of work like that,' said Humpty
Dumpty, 'I always pay it extra.'
The question is how much extra do UML committees pay to
the terms “association” and “association end”?
Adding navigation to tables
History of music
Ownership and navigability
Meanings of the terms “association” and “association end“
in function of the ownership context
Association A owns an end E
“A” is a table and E is
a column name
“A” is a set of mappings between
classifiers, which have a common
extension [[A]]. End E is a
mapping, which is not stored yet
can be derived from [[A]]
“A” is a mappings between classifiers,
and E is a placeholder for the
corresponding part of the multiplicity
constraints to this mapping
“A” owns all its
Metamodel of our formal semantics: Playing LEGO
UML2 metamodel of Association, processed
Results and discussion
emantics of the association construct can be uncovered
in a few
sections of the Spec, and is presented
there in a sufficiently consistent way. However, the part of this semantics
formally captured in the
is much poorer and
that is why
the latter is ambiguous (recall our Cylinder model).
Particular technical problems
of the UML metamodel of associations:
is missing, which makes the fundamental
metaclass Property underspecified (in fact, undefined);
is improperly defined: its target must be the
metaclass Role rather then Property;
a few important constraints are missing (see the paper).
Deeper conceptual problems:
fundamental dichotomy associations
mappings vs. associations
is not specified;
fundamental dichotomy basic
derived element of association is not specified.
A these red problems really so bad?
Results and discussion (with Carroll and Wittgenstein)
UML as a specification language
must be clear, precise and
unambiguous. Formal semantics can really help here.
UML as a communication language
does not ought anything besides
being convenient and usable (like other natural languages). As for
multiple meanings of its terms, recall Wittgenstein’s Thesis:
meaning of a word is determined by its use.
Would you tell me, please, which way I ought to
go from here?' asked Alice.
`That depends a good deal on where you want
to get to,' said the Cat.
`I don't much care where‘ said Alice.
`Then it doesn't matter which way you go,' said
Is it possible to reconcile these two UMLs (and a few ones in
Language = Syntax + Semantics,
the latter is changeable and determined by the context. Hence,
annotate UML diagrams with their intended meaning (to specify, to
suggest, to inspire :)
Introduce into UML special constructs for under
UML is a language,
and understanding UML is a linguistic activity