– 6 – 2015-11-12 – main –
Software Design, Modelling and Analysis in UML
Lecture 6: Class Diagrams I
2015-11-12
- Prof. Dr. Andreas Podelski, Dr. Bernd Westphal
Albert-Ludwigs-Universit¨ at Freiburg, Germany
Lecture 6: Class Diagrams I 2015-11-12 Prof. Dr. Andreas Podelski, - - PowerPoint PPT Presentation
Software Design, Modelling and Analysis in UML Lecture 6: Class Diagrams I 2015-11-12 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal 6 2015-11-12 main Albert-Ludwigs-Universit at Freiburg, Germany Course Map N UML W E CD
– 6 – 2015-11-12 – main –
Albert-Ludwigs-Universit¨ at Freiburg, Germany
– 6 – 2015-11-12 – Sprelim –
2/27
N S W E
CD, SM S = (T, C, V, atr ), SM M = (ΣD
S , AS , →SM )
ϕ ∈ OCL expr CD, SD S , SD B = (QSD, q0, AS , →SD, FSD) π = (σ0, ε0)
(cons0,Snd0)
− − − − − − − − →
u0
(σ1, ε1)· · · wπ = ((σi, consi, Sndi))i∈N G = (N, E, f)
OD
– 6 – 2015-11-12 – Sprelim –
3/27
Last Lecture:
This Lecture:
– 6 – 2015-11-12 – main –
4/27
– 6 – 2015-11-12 – Sstock –
5/27
– 2 – 2015-10-22 – Ssemdom –
7/34 S = (T, C, V, atr ) where
Example:
– 6 – 2015-11-12 – Sstock –
6/27
+ r : C0,1 = expr s : D∗ {ordered} − v : Int = 27 w : Float {readOnly}
y : Int
{A}
x : Int
– 6 – 2015-11-12 – Sstock –
7/27
A class
+ r : C0,1 = expr s : D∗ {ordered} − v : Int = 27 w : Float {readOnly}
A
y : Int
B
{A}
D
x : Int
Each attribute has
Wanted: places in the signature to represent the information from the picture.
– 6 – 2015-11-12 – main –
8/27
– 6 – 2015-11-12 – Sextsig –
9/27
S = (T, C, V, atr ) where
:=+
, private
:=−
, protected
, package
} is the visibility,
initial value expressions, e.g. OCL, or C++ in the Rhapsody tool,
We use SC to denote the set
C∈C SC of stereotypes in S .
– 6 – 2015-11-12 – Sextsig –
10/27
we simply write C i.e. old definitions are still valid.
All definitions we have up to now principally still apply as they are stated in terms of, e.g., C ∈ C — which still has a meaning with the extended view. For instance, system states and object diagrams will remain mostly unchanged.
the constitution of system states or object diagrams.
– 6 – 2015-11-12 – main –
11/27
– 6 – 2015-11-12 – Scdmap –
12/27
A class box n induces an (extended) signature class as follows: n:
ξ1 v1 : T1 = expr 1
0 {P1,1, . . . , P1,m1}
. . . ξℓ vℓ : Tℓ = expr ℓ
0 {Pℓ,1, . . . , Pℓ,mℓ}
V (n) := {v1 : T1, ξ1, expr 1
0, {P1,1, . . . , P1,m1}, . . . , vℓ : Tℓ, ξℓ, expr ℓ 0, {Pℓ,1, . . . , Pℓ,mℓ}}
atr(n) := {C → {v1, . . . , vℓ}} where
a(n) =
, if n = C
C {A} false , otherwise
t(n) =
, if n = C
C false , otherwise
– 6 – 2015-11-12 – Scdmap –
13/27
ξ1 v1 : T1 = expr1
0 {P1,1, . . . , P1,m1}
. . . ξℓ vℓ : Tℓ = exprℓ
0 {Pℓ,1, . . . , Pℓ,mℓ}
V (n) := {v1 : T1, ξ1, expr1
0, {P1,1, . . . , P1,m1}, . . . ,
vℓ : Tℓ, ξℓ, exprℓ
0, {Pℓ,1, . . . , Pℓ,mℓ}}
atr(n) := {C → {v1, . . . , vℓ}}
+ r : C0,1 = expr s : D∗ {ordered} − v : Int = 27 w : Float {readOnly}
A
y : Int
B
{A}
D
x : Int
– 6 – 2015-11-12 – Scdmap –
14/27
It depends.
“Presentation Options. The type, visibility, default, multiplicity, property string may be suppressed from being displayed, even if there are values in the model.”
(extended) signature. Some (and we) assume public as default, but conventions may vary.
what is “leftmost” of Z?). Some (and we) understand non-deterministic initialisation if not given.
– 6 – 2015-11-12 – Scdmap –
15/27
ξ1 v1 : T1 = expr1
0 {P1,1, . . . , P1,m1}
. . . ξℓ vℓ : Tℓ = exprℓ
0 {Pℓ,1, . . . , Pℓ,mℓ}
V (n) := {v1 : T1, ξ1, expr1
0, {P1,1, . . . , P1,m1}, . . . ,
vℓ : Tℓ, ξℓ, exprℓ
0, {Pℓ,1, . . . , Pℓ,mℓ}}
atr(n) := {C → {v1, . . . , vℓ}}
+ r : C0,1 = expr s : D∗ {ordered} − v : Int = 27 w : Float {readOnly}
A
y : Int
B
{A}
D
x : Int
– 6 – 2015-11-12 – Scdmap –
16/27
(each “class rectangle” is a node).
i=1 V (ni)
i=1 atr(ni)
C D = {CD1, . . . , CDk}, which induce the following signature: S (C D) =
k
C (CDi),
k
V (CDi),
k
atr(CDi)
(Assuming T given. In “reality” (i.e. in full UML), we can introduce types in class diagrams, the class diagram then contributes to T . Example: enumeration types.)
– 6 – 2015-11-12 – Scdmap –
17/27
Question: Is S (C D) well-defined?
– 6 – 2015-11-12 – main –
26/27
– 6 – 2015-11-12 – main –
27/27 Oestereich, B. (2006). Analyse und Design mit UML 2.1, 8. Auflage. Oldenbourg, 8. edition. OMG (2011a). Unified modeling language: Infrastructure, version 2.4.1. Technical Report formal/2011-08-05. OMG (2011b). Unified modeling language: Superstructure, version 2.4.1. Technical Report formal/2011-08-06. Schumann, M., Steinke, J., Deck, A., and Westphal, B. (2008). Traceviewer technical documentation, version 1.0. Technical report, Carl von Ossietzky Universit¨ at Oldenburg und OFFIS.