Travelling Reporter
UML for Global Computing Martin Wirsing LMU München in cooperation with Hubert Baumeister, Piotr Kosiuczenko, Nora Koch Stephan Merz, Julia Zappe
GC Summer School, Edinburgh, July 2003
M. Wirsing: UML for Global Computing
Global Computing
Current ...
„massive networked infrastructure composed of highly diversed interconnected objects“
Software Engineering Standards (UML) ¾
support only particular features of GC such as concurrency and real time
EU Initiative „Global Computing“
Systems which support dynamic configuration complex topologies autonomous and mobile objects
Programming Languages (C++, Java, ML, Haskell, ...) ¾
Middleware (CORBA, Jini, COM, SOAP, .Net, ...) improves on client server model but ¾ are based on simple topology assumptions (e.g. TCP) ¾ support only particular aspects of GC ¾ have no (good) support for validation&verification ¾
Mobile Computing (Mobile Hardware) Mobile Computation (Mobile Code) M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
Global Computing needs ...
New support for software development ¾ ¾
The AGILE Project
Goal: Architectural approach to mobile systems development over a uniform mathematical framework supporting
New features for modeling languages Adequate development processes
New features for programming languages and middleware
and
Coupling of pragmatic and formal techniques for analysis, validation, verification of GC systems
support only particular features of GC such as concurrency and distribution
sound methodological principles, formal analysis, and refinement across levels of development
2002-2005, sponsored by EC Initiative on “Global Computing”
Partner: LMU München, ATX Lissabon, U. Pisa, U. Lissabon, U. Florenz, ISTI Pisa, U. Warschau, U. Leicester
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
1
Agile Approach Case Studies
Mobile Applications
Existing Modeling Languages
Contents
Lecture 1: Introducing UML for Mobility
Mobile UML
Structural View on Distribution&Mobility
Architectural Views
+
Algebraic Models of System Evolution
M. Wirsing: UML for Global Computing
Unified Modeling Language
between developers developers and users (?)
Definition of different views
A number of modelling concepts A concrete notation
Supports “Unified Process” development method
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
UML Description Techniques
Structure:
Description of essential program characteristics like a construction plan Structuring the problem as well as the solution Abstracting from implementation details
“Unification” of several predecessor methods First standardization attempt Sep. 1997 by OMG Current version 2.0 (Notation of Lecture 1.5) Developed by Booch, Rumbaugh (OMT), Jacobson (OOSE)... Consist of:
Goals of the UML
Graphical modelling language for OO systems Means of communication
Lecture 2: Refining Mobility Designs Lecture 3: Property-Driven Development of Mobile Systems
Graph-Orientied Semantic Framework (Categ. Dgrms + Graph Transform. + Tile Logic + Institutions)
Uniform Mathem. Basis
Use Case Driven design Class Diagrams Sequence Diagrams Activity Diagrams
Class diagram
(UML) Software Engineering Principles
system
Requirements, Functionality:
Use Case Diagram
Activity Diagram
View-oriented system modelling partial views
Interaction, Behaviour:
Object diagram
Sequence diagram
Collaboration
Statechart
Implementation:
M. Wirsing: UML for Global Computing
Component Diagram Deployment Diagram
Object Constraint Language (OCL)
Use case Arrival Includes Landing Description The plane is landing. Then the passengers deplane and the luggage is unloaded. If the passenger has luggage then the passenger claims its luggage.
Airport
Flight
Passenger
UML documents
A system is described by several documents from several viewpoints M. Wirsing: UML for Global Computing
2
(UML) SE Principles (cont‘d)
Use Case Driven Design
Principle of underspecification Data encapsulation and separation of interfaces and implementations Incremental development by refinement steps Hierarchical composition and decomposition
M. Wirsing: UML for Global Computing
Use cases serve as functional requirement description and provide test cases
M. Wirsing: UML for Global Computing
Use Case Diagram: Example Airport
Major Development Steps Identify use cases
Identify classes of the application domain
Use case diagram, scenarios, activity diagrams
Class diagram oo view
Use Case an interaction between user and system which serves to fulfill a task where “system” = software to be developed “user” = person or external system called “actor”
use case use case
TakingOff
Departure
functional view
Specify the overall system
actoractor Airport
Class diagram + behavior specifications
oo view Passenger
Develop system architecture Architectural design M. Wirsing: UML for Global Computing
refinement
Use Case Description: Example
M. Wirsing: UML for Global Computing
Landing
Plane
Flight M. Wirsing: UML for Global Computing
Class Diagram
Use case Arrival Includes Landing Actors plane, passenger Description The plane is landing. Then the passengers deplane and the luggage is unloaded. If the passenger has luggage then the passenger claims its luggage.
Arrival
A class diagram defines the static structure of the system consisting of classes and interfaces connected by static relationships such as association, aggregation and inheritance
M. Wirsing: UML for Global Computing
3
Classes for Mobile Objects
Example: Class Diagram for Airport Country name
Goal of the extension
Extensions
1
* has Airport
name origin 1
* Flight
type numberOfSeats land() takeOff()
run *
*
UML profile for mobility with stereotypes for locations, mobile objects, and mobile locations
1 destination
* Plane
Explicit notations for mobile objects and locations
Passenger
number date boardingTime gate
*
*
name eat() board() deplane()
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
Abstract Classes for Mobility: 1st Approach
Abstract Classes for Mobility: 2nd Approach *
atLoc
0..1 *
Spatial
atLoc
0..1
*
atLoc
Location
0..1
Mobile Object
Location
Mobile Object
Mobile Location
Mobile Location
Problem: Mobile Location inherits „atLoc“ twice: from Location and from Mobile Object
Improvement: Due to the introduction of the abstract class „Spatial“, Mobile Location inherits „atLoc“ only once, but ...
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
Spatial
Solution: UML Profile for Locations Location
Abstract classes lead to complex class diagrams
Mobile Object
Each instance has at most one attribute atLoc; atLoc has no cycles
Class
Mobile Location
spatial
Country
Airport
Plane
Flight
location
mobile
Passenger
mobile location M. Wirsing: UML for Global Computing
4
Sequence Diagram
Example: Class Diagram for Airport Country name
A sequence diagram describes a scenario, i.e. an exemplary message flow where primary scenario: the typical case secondary scenario: variant, exceptional case Scenarios can describe different levels of abstraction e.g. for use case, components, operations Other description technique for scenarios: collaboration diagrams
1
* has Airport name origin
Plane type run numberOfSeats * land() takeOff()
1
1 destination
*
*
Passenger
Flight
*
number date boardingTime gate
*
name eat() board() deplane()
*
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
Sequence Diagram
Example: Check In
: Passenger object symbol
name : Class
lifeline
checksIn ()
stimulus
whichSeat
name (...)
activation
new (...)
returnChoice ()
: Class delete
return
Sequence Diagrams for Mobility
ap [at = JFK] ps [at = ap]
Complex model, mobility not explicit M. Wirsing: UML for Global Computing
: Ticket
send ()
M. Wirsing: UML for Global Computing
Mobile runs with SD: A first approach
board( )
print ()
new ()
create
M. Wirsing: UML for Global Computing
ps [at = JFK]
: CheckIn Machine
other
notice( )
notice( )
fly( )
ap [at = MUC] deplane( )
ps [at = MUC]
SDM are an extension of SD for modelling the interaction between objects topology - the containment relation the migration of objects Idea blow up lifelines and message arrows for modelling topology generalize the concept of lifeline to contain object flow for modelling mobility
M. Wirsing: UML for Global Computing
5
Migration of an Object ps
Copying Objects
pl c
942 : PC
131: PC
b
virus
virus
ps
A person ps migrates into the plane pl and leaves it .
c migrates through a firewall into b and terminates at the same time as b.
The mobile Object virus in PC 131 is copied; the copy lifes in PC 942
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
Advanced Features
Opening and Destroying an Object
a
b
c
b
a d
An „open“ message terminates b; the inner objects c and d continue to life
c
d
Zoom-in/zoom-out view
Matching action boxes
Lifeline of a migrating object
A „destroy“message terminates b, c und d.
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
Pattern Matching
Zoom-Out View
131: PC
Representation of mobile objects and object configurations by terms
942 : PC
virus
virus
[cf. Maude]
Object constructor: f : Names x Objects ---> Objects Configuration constructor * : Objects x Objects ---> Objects Empty configuration ε : ----> Objects Variables X: Names
Unification modulo commutativity and associativity for computing the names of migrated objects
Using Zoom-Out one may hide details of inner objects; only the communication with outer objects remains visible.
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
6
Pattern Matching Beispiel
The Traveling Reporter Example c
c before migration: f(c, f(e, ε) * f(d, f(z, ε)) a after migration of c : f(a, f(b, ε) * f(X1, f(X2,f(X3,ε))* f(X4,ε)))
d z
e
a b
The traveling reporter flies from New York to Munich
x e
x after migration of a : f(x, f(Y1, f(Y2, f(Y3,ε)*f(Y4, ε)) * f(Y5, ε)))
Pattern matching of the 3 terms gives: {X1 −> c, X2 −> d, X3 −> z, X4 −> e, Y1 −> a, Y2 −> c, Y3 −> z, Y4 −> e, Y5 −> b} M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
Flight from New York to Munich
Flight from New York to Munich
USA JFK LH1 : Plane
USA
EU JFK
: Pass
D
x
LH1 : Plane
flight99
D
x
WAN
GB
M. Wirsing: UML for Global Computing
GB
M. Wirsing: UML for Global Computing
Flight from New York to Munich
Flight from New York to Munich USA
LH1 : Plane
: Pass
flight99
WAN
JFK
EU
EU
USA
JFK
: Pass
D
x
LH1 : Plane
EU : Pass
D
x
MUC
MUC
flight99
flight99
: Pass WAN
GB
WAN
x
M. Wirsing: UML for Global Computing
LH1 nb dc p
x dc dc
: Pass GB
p
x
M. Wirsing: UML for Global Computing
7
Flight from New York to Munich
Activity Diagrams
USA
EU
JFK LH1 : Plane
: Pass
D
x
MUC
flight99
LH1 nb dc
WAN
x dc dc
p
: Pass
Activity diagrams are intended for applications that need control flow or object/data flow models An activity graph describes a flow of actions which are connected by transitions Concurrency is expressed by fork and join states Swimlanes represent responsibilities of parts of the activity diagram
GB
p
x
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
Activity Diagram Example: Arrival
Activity Diagram with Flow States MW
MW
LH1
boarding
take off
Fork state
Action
LH1
MW [atLoc = JFK]
Flow state
boarding
Take off
MW [atLoc = LH1]
send mail
flying
deplaning
send mail
landing
Join state
M. Wirsing: UML for Global Computing
Activity diagrams for Mobility
flying
deplaning
landing
M. Wirsing: UML for Global Computing
Responsibility Centered View MW
Goal of the extension
To model how actions change the location of mobile objects
Extensions
LH1
MW [atLoc = JFK]
LH1 [atLoc = JFK]
boarding
Take off
MW [atLoc = LH1]
LH1
Stereotypes / for actions Two Notations
send mail
flying
Responsibility Centred Location Centred MW [atLoc = MUC]
M. Wirsing: UML for Global Computing
deplaning
landing
LH1 [atLoc = MUC]
M. Wirsing: UML for Global Computing
8
Move Actions
Modeling the Flight
JFK : Airport MW [atLoc = JFK]
MW [atLoc =LH1]
boarding
MUC : Airport flying
LH1 : Plane
MW
boarding
LH1 : Plane
landing
MW
MW
LH1 : Plane JFK
LH1
send mail
MW
MW
Take off
MW
deplaning
boarding MW
M. Wirsing: UML for Global Computing
M. Wirsing: UML for Global Computing
Summary and Current Work
Summary
First approach for explicit modeling of mobility in UML Simple solution Used already in industry and for teaching (DEGAS-Project, SWE-Praktikum)
Current Work
Semantic Foundation (Translation to GTS and Tiles with Corradini/Montanari, Coordinated Categories with Fiadeiro, Mobile TLA with Merz)
M. Wirsing: UML for Global Computing
9