05 - UML Structural Diagrams Other Diagrams PDF
05 - UML Structural Diagrams Other Diagrams PDF
Structural specification:
beyond class diagrams
Alexander Serebrenik
Before we start
1 Association A
2 Aggregation B
3 Composition C
4 Implementation D
5 Generalization E
6 Dependency F
x y
Patient Doctor
Determine x and y
Slides by Site by
Class diagram
Packages
groups of basic elements, e.g., classes or use cases
namespaces, i.e., all members should have unique names
represented as file folders
can contain other packages, creating hierarchy
Relations
dependencies, implementations,
imports and merges
Types
Types
Temporal
Dependency
Implementation
Import / access
Merge
Graphic representation:
or <<use>>
Relations: Dependencies
Package A depends on package B if A contains a class
which depends on a class in B
Summarise dependencies between classes
Typical 3-tier application (sketch):
UI, web-interface,
Presentation layer services to other
systems
Core calculations,
Business layer operations, etc
Fowler:
If there are cycles in dependencies, these cycles should be
localized, and, in particular, should not cross the tiers
Relations: Implementations
Database
Gateway
SQL Server
Oracle Gateway MySQL Gateway
Gateway
p
r
A B C
foo
D E s
17
Do you remember?
p
r
A B C
foo
D E s
19
Element Import (1)
e b
a
<<import>>
F
h F
D
C C
e b
a
<<import>>
F
h FC
D
C or C
e b
a
<<import>>
F
h FC
D
C
should be C
referred as e::C
in a
e b
a
<<import>>
F
h F
D
C C
e b
a
<<import>>
F
h F
D
C C
b::F is accessible as G in h, b::C is
accessible as C in h, b::D is not
accessible in h (private visibility of
b::D in a due to <<access>>).
/ SET / W&I 24-2-2014 PAGE 25
Package import (1)
<<import>>
shoppingCart webShop
types
Are elements of types accessible from shoppingCart?
Are elements of auxiliary accessible from shoppingCart?
/ SET / W&I 24-2-2014 PAGE 27
Package import (2)
<<import>>
shoppingCart webShop
types
Are elements of types accessible from shoppingCart? YES
Are elements of auxiliary accessible from shoppingCart? YES
/ SET / W&I 24-2-2014 PAGE 28
Relations: Recap
Dependency
Implementation
Import / access
Merge
s receiving package
merged package
D q
<<merge>>
A C
A B
s resulting package
Copied D
from s Copied
C from q
s receiving
package merged package
A q
<<merge>>
A B
B
s resulting
Merge of s::A package
and q::A
A
Merge of s::B
and q::B B
/ SET / W&I 24-2-2014 PAGE 33
Summary: UML package diagrams
http://www.uml-diagrams.org/package-diagrams-overview.html
/ SET / W&I 24-2-2014 PAGE 34
How do we organize classes/use-cases in
packages?
General: try to give packages meaningful names
Person
Car Driver
4 1
Driving License
Wheel Engine
2,4,6,8,10,12
Cylinder
Car Driver
4 1
Driving License
Wheel Engine
2,4,6,8,10,12
Cylinder
Individual
Vehicle
http://www.students.tut.fi/~kontrom/files/Lecture6.pdf
Class diagram
<<component>>
Account Account
Account
UML 1 UML 2
/ SET / W&I 24-2-2014 PAGE 44
Component diagrams
provided required
interface interface
/ SET / W&I 24-2-2014 PAGE 46
Component diagrams
http://www.uml-diagrams.org/component-diagrams.html
/ SET / W&I 24-2-2014 PAGE 49
UML structure diagrams
Class diagram
Nodes DBServer
devices: application server, client workstation,
execution environments: DB system, J2EE container,
Graphical representation: box
Nodes DBServer
devices: application server, client workstation,
execution environments: DB system, J2EE container,
Graphical representation: box
Nodes can be physically connected (e.g., via cables or
wireless)
UML-parlance: CommunicationPath
Graphical representation: as an association
ShoppingCart.jar
Relations: dependencies
http://www.uml-diagrams.org/deployment-diagrams.html
24-2-2014 PAGE 55
Deployment: missing piece