Upload
robyn-mcdowell
View
218
Download
1
Tags:
Embed Size (px)
Citation preview
Nicolò Carissimi
in UML 2.0
Summary• what’s behind UML: MDA• UML 2.0 and MDA key concepts
Model Driven Architecture
• a specific software development approach (developed by the Object Managment Group) that shifts the focus from the “code” to the “model” and automatically keeps a relation between them
• a MDA specification consists of:– a Platform Independent Model (PIM)– one or more Platform Specific Models (PSM), each describing how
the base model is implemented on a different middleware platform
• the mapping from a PIM to a PSM is implemented by tools
• system's functionality and behavior are modeled once and only once
UML is the language used for modelling
what’s behind UML: MDA
UML 2.0 and MDA key concepts (1)two MDA’s key concepts guided the improvements over Uml 1 and its
syntax and semantic:
• Automation (of the software development process steps)
– code generation
– verification of software specifications
– ability to execute abstract and incomplete models early in the development cycle
– test cases generation
• Abstraction (the essence of modelling)
the ability to represent a complex system and all its components, with their architecture, behaviour and interactions
UML 2.0 and MDA key concepts (2)improvements over Automation:• increased precision and consistency for complex modelling tools (no
ambiguity)• more formal definition of the meaning of the modelling concepts and
their mutual relationships
improvements over Abstraction:
• improved architecture modeling capabilities (distilled from existing architectural description languages and standards such as Acme, MSC 2000, SDL 2000 and UML-RT) with new diagrams, such as:
– Component Diagrams
– Composite Structure Diagrams
• scalability (the ability to decompose structures at a hierarchical level to an arbitrary level of complexity), with the possibility to refer components’ architecture and interaction defined in separated diagrams
Other UML 2.0 features• complete backward compatibility with UML 1.x
• stronger integration between structure, behaviour and interaction diagrams
• the language has become more complex, so UML 2.0 has been modularized into a set of sublanguages, many of which are independent between each other
Summary• Sequence Diagrams in UML 2.0
• Interaction Frame• Operators
Sequence Diagrams in UML 2.0
two primary improvements:
• “spec-ness”, the ability to specify things, which means less “natural-language notes” and consequently less ambiguity)
• scalability, (here) the ability to reference interactions defined in separated diagrams, thus obtaining a kind of “nested” diagram organization (an interaction is the interplay of messages sent between objects over time for a specific purpose)
Interaction Frame (1)
• What is it? basically, an interaction frame consists of some region of a sequence diagram that is divided into one or more fragments; each frame has an operator and each fragment may have a guard
• How does it realize the aforementioned improvements?• “spec-ness” operators allow to formally express actions which, in UML 1, could only be expressed with the use of notes written in natural language
• scalability diagrams enclosed in a frame can be named and referred in other diagrams
Interaction Frame (2)
op [:arguments]
diagram name | interaction
[ [guard] ]
op (operator):applied to the enclosed interaction(s)(some operators require arguments, such as diagrams names,parameters, constants and guards)
[guard]:a boolean expressionthe interaction is executed accordingto the guard’s value
diagram name:needed if we want to refer to a diagram defined elsewhere
interaction:a (fragment of a) sequence diagram (it cancontain other frames)if we need to enclose more interactions,we’ll separate them with an outlined line(see next slide)
Interaction Frame (3)
op
interaction_1
[guard_1]
…
interaction_n
[guard_n]
this is another example of an interaction frame:
• a set of interactions is divided by an outlined line
• interaction_i is executed if guard_i is true
in the next slides we’ll see the correct syntax for each operator, with its meaning and some examples
Sequence Diagrams: operators (1)sd: <diagram name> (parameters)
it names the diagram contained in the frame
parameters are optional (they can be used if the diagram behaves in different
ways when it’s referred in different occurrences, see this example)
Sequence Diagrams: operators (2)ref
it refers to a diagram defined elsewhere with the sd operatorthe name of the referred diagram is specified in the middle of the frame (with optional parameters closed within round brackets if the referred diagram needs them)
Sequence Diagrams: operators (3)loop minint, maxint [guard]
(think of it as the “for” or “while” statements)
minint: the interaction must loop at least this number of times
maxint (optional): the interaction may not loop more than this number of times
[guard] (optional): after the first minint iterations, the condition is tested
before each additional loop iteration: if the condition is false, then the loop is
abandoned
Sequence Diagrams: operators (3)break
if the selected interaction occurs, the enclosing interaction (in the example below, the one contained by the loop frame) is abandoned
Sequence Diagrams: operators (4)alt
it selects one interaction to be executed from a set of interactionsthe selected interaction follows a true [guard] condition or an [else] condition if none of the guard conditions are true (think of it as the “case” of “if” statements);guards are specified over the lifeline of the object which eventually contains the evaluated variable(s)
Sequence Diagrams: operators (5)opt
the enclosed interaction occurs only if [guard], specified over the lifeline of the object which eventually contains the evaluated variable(s), is true
Sequence Diagrams: operators (6)NOTE: actually the standard gives only a brief description of the following operators and does
not provide an intuitive explanation of their meaning or usage.
assert
the selected interaction must occur exactly in the indicated way, if it doesn’t, you have
an invalid interactionsee http://www.pst.informatik.uni-muenchen.de/personen/stoerrle/V/CSDUML.pdf for some possible interpretations
region
the enclosed interaction is a critical region, no other messages can interleave;
a critical region is needed when a shared resource is updated to prevent the updates from
overlapping and producing inconsistent results;you would typically use this within
parallel interactions
Sequence Diagrams: operators (7)
neg
the enclosed interaction is invalid and can’t occur (it can be used, for example, to model a use case extension which ends with failure)
see http://www.pst.informatik.uni-muenchen.de/personen/stoerrle/V/CSDUML.pdf for some possible interpretations
par
this operator indicates several interactions that may run concurrently (overlapped in time)
seq
partial ordering, “weak”
strict
strict ordering
References• UML 2 Sequence Diagram Overview
http://www.agilemodeling.com/artifacts/sequenceDiagram.htm
by Scott W. Ambler
• UML 2.0: Exploiting Abstration and Automation
http://www.sdtimes.com/opinions/guestview_098.htm
by Brian Selic, IBM Rational Software Canada
• UML 2.0 Incrementally Improves Scalability And Architecture
http://www.elecdesign.com/Articles/Index.cfm?ArticleID=5881
by Bruce Powel Douglas, ED Online
• “Architecting Systems with UML 2.0”
http://www.uml-forum.com/out/pubs/IEEE_SW_Jul03_p57.pdf
by Morgan Björkander and Cris Kobryn, Telelogic
• “UML 2.0 For Dummies”
by Michael Jesse Chonoles and James A. Schardt
Ed. Hungry Minds © 2003
Sequence Diagrams: sd operatorthe diagram Fare_Fase has an input parameter f which makes the sequence diagram
behave in different ways according to it’s value
<< back