here

erminerebelΤεχνίτη Νοημοσύνη και Ρομποτική

15 Νοε 2013 (πριν από 3 χρόνια και 6 μήνες)

80 εμφανίσεις

Zinovy Diskin and Juergen Dingel


Queen’s University

Kingston, Ontario, Canada

Mappings
,
maps

and
tables
: Towards formal
semantics for associations in UML 2

The speaker

The UML 2.0 Semantics Project

UML Semantics

Presentation

Page

2

Why Associations:


Any UML model of practical interest is built upon the structural base
specified by class diagrams. The latter are graphs of classes
(nodes) and
associations

(edges).



Associations

are glue that integrate classes into a system” (Jim
Rambaugh).


Metamodeling is based on class diagrams, thence, on
asociations
.



Hence, semantics of the association construct should be clear and
precise. Does UML2 specification meet these requirements?

UML Semantics

Presentation

Page

3

UML2 Spec defines associations in sect.7.3.3.


The 1
st

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.


Description

section.

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
ends.


Semantics
section. For an association with N ends, choose any N
-
1
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
collection.


UML Semantics

Presentation

Page

4

UML metamodel of Associations

UML Semantics

Presentation

Page

5

UML2 metamodel of Association, processed

{
subsets memberEnd}

{
subsets ownedEnd}

There are some things so serious you
have to laugh at them.

--

Niels Bohr

UML Semantics

Presentation

Page

6


A model of the Association Problem…



1

2

3

UML Semantics

Presentation

Page

7

…and a model of solution: Consider an appropriate
model and different views to it



Net surface

(Cylinder 1)

Three views of the model

Side surface

(Cylinder 2)

3D
-
space

(Cylinder 3)

UML Semantics

Presentation

Page

8

Our plan

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 :)

UML Semantics

Presentation

Page

9

Three views of association

UML

PL & UML

DB & UML

Extension is
explicit!

UML Semantics

Presentation

Page

10

Lewis Carroll about UML Associations:


'When
I

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
can

make words
mean so many different things.'


'The question is,' said Humpty Dumpty, 'which is to be
master
-

that's all.'

<….>


'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”?


UML Semantics

Presentation

Page

11

Adding navigation to tables

Student

Course

Lecturer

row 1

John

UML modeling

Smith

row 2

Mary

History of music

White

row 3



Mary

….

UML modeling

….

Brown

…..

*



UML Semantics

Presentation

Page

12

Ownership and navigability

/f
2

{ inverse}

f
2

1..3

f
1

0..2





?



?

f
2
is navigable

f
2
is
not

navigable

Structural view

Operational view

Extensional view

UML Semantics

Presentation

Page

13

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
not all

its
ends

“A” owns all its
ends

“E” is
navigable

“E” is
not
navigable

UML Semantics

Presentation

Page

14

Metamodel of our formal semantics: Playing LEGO
with associations

Property’s
context!

Qualifier!

UML Semantics

Presentation

Page

15

UML2 metamodel of Association, processed

{
subsets memberEnd}

{
subsets ownedEnd}

UML Semantics

Presentation

Page

16

Results and discussion

General conclusion:

S
emantics of the association construct can be uncovered
in a few
Semantics

and
Description

sections of the Spec, and is presented
there in a sufficiently consistent way. However, the part of this semantics
formally captured in the
UML metamodel

is much poorer and
that is why

the latter is ambiguous (recall our Cylinder model).

Particular technical problems

of the UML metamodel of associations:

--

meta
-
association
context
is missing, which makes the fundamental
metaclass Property underspecified (in fact, undefined);

--

meta
-
association
qualifier
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
-
as
-
mappings vs. associations
-
as
-
tables
is not specified;

--

fundamental dichotomy basic
-
derived element of association is not specified.


A these red problems really so bad?


UML Semantics

Presentation

Page

17

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:
The
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
the Cat.

Is it possible to reconcile these two UMLs (and a few ones in
-
between) ?

1)
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 :)

2)
Introduce into UML special constructs for under
-
specification

UML is a language,

and understanding UML is a linguistic activity