Introduction to UML (Unified Modeling...
Transcript of Introduction to UML (Unified Modeling...
![Page 1: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/1.jpg)
Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Introduction to UML (Unified Modeling Language)
Minsoo Ryu
Hanyang University
![Page 2: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/2.jpg)
2Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 2Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Contents
1. Overview of UML2. Structural Diagrams3. Behavioral Diagrams
![Page 3: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/3.jpg)
3Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 3Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
UML Definition
UML is a visual modeling language for distributed and concurrent systems Visual modeling - a way of thinking about problems using
models organized around real-world ideas Model - an abstraction that portrays the essentials of a
complex problem or structure by filtering out nonessential details, thus making the problem easier to understand
UML is officially defined at the Object Management Group (OMG) by the UML metamodel, a Meta-Object Facility metamodel (MOF) UML was designed to specify, visualize, construct, and
document software-intensive systems
![Page 4: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/4.jpg)
4Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 4Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
UML Definition
Triangle for success Notation: a language for communication (semantics and a
form) Process: a way of using the notation Tool: support to document the artifacts of the work
Notation
Process Tool
![Page 5: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/5.jpg)
5Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 5Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
UML History
“Method wars” during the nineties: confusion brought by different notations OMT (Object Modeling Technique, James Rumbaugh)
• strong in analysis and weaker in design OOD (Object Oriented Design, Grady Booch)
• weaker in analysis and strong in design OOSE (Object Oriented Software Engineering, Ivar Jacobson)
• strong in behavior analysis and weaker in others
The end of the method as far as notation is concerned Version 0.8 (October, 1995): The first public draft Version 0.9 (July, 1996), version 0.91 (October, 1996) Version 1.0 (Jan, 1997)
• Under the technical leadership of the Three Amigos, proposed by an international consortium called the UML Partners
Version 1.1 (November, 1997)• Semantics were finalized
![Page 6: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/6.jpg)
6Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 6Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
UML History
UML 2.0 Several minor revisions: UML 1.3, 1.4, 1.5 The first part of UML 2.0, the Superstructure which describes
the new diagrams and modeling elements available, was adopted by the OMG in October 2004
Other parts of UML 2, notably the infrastructure, the Object Constraint Language (OCL) and the diagram interchange were yet to be completed and ratified as of November 2005
Now UML version 2.3 is the latest one
![Page 7: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/7.jpg)
7Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 7Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
UML Diagram Classification
Structure Diagrams Emphasize what things must be in the system being modeled:
Behavior Diagrams Emphasize what must happen in the system being modeled
Interaction Diagrams (a subset of behavior diagrams) Emphasize the flow of control and data among the things in
the system being modeled
![Page 8: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/8.jpg)
8Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 8Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Hierarchy of UML Diagrams
![Page 9: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/9.jpg)
9Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 9Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Contents
1. Introduction to UML2. Structural Diagrams
• Class Diagram• Component Diagram
3. Behavioral Diagrams
![Page 10: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/10.jpg)
10Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 10Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Class and Class Diagram
What is a class? A class defines what information an object can hold and what
behavior it can have A class provides a blueprint for an object, and simply
provides a template for objects
A class diagram is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, and the relationships between the classes
![Page 11: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/11.jpg)
11Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 11Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Class Structure and Representation
Attributes can appear in an optional compartment Each attribute is shown with at least its name, and optionally
with its type, initial value, and other properties
"+" for public "#" for protected "−" for private "~" for package
Operations can appear in another compartment Each operation is shown with at least its name, and
optionally also with its parameters and return type
![Page 12: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/12.jpg)
12Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 12Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Class Diagram
![Page 13: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/13.jpg)
13Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 13Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Class Stereotypes
A stereotype conveys a high level category, type, or meaning of an item A stereotype is a mechanism you can use to categorize your
classes
![Page 14: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/14.jpg)
14Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 14Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Class Stereotypes
There are three primary class stereotypes in UML that are used for analysis Boundary, entity, and control
![Page 15: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/15.jpg)
15Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 15Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Relationships
A relationship is a semantic connection between classes It allows one class to know about the attributes, operations,
and relationships of another class
Types of relationships Associations Aggregations Compositions Generalizations Realizations Dependencies
![Page 16: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/16.jpg)
16Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 16Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Associations
When an association connects two classes, each class can send messages to the other
first relationship
role
![Page 17: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/17.jpg)
17Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 17Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Associations
Instead of roles, another way to state the association is to write its meaning in terms of verb phrases By convention, the phrase is placed next to the direct object
of the sentence
![Page 18: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/18.jpg)
18Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 18Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Associations
Associations can also be reflexive A reflexive association suggests that one instance of a class
is related to other instances of the same class
![Page 19: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/19.jpg)
19Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 19Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Aggregations
Aggregations are used to depict elements which are made up of smaller components. An “has a” relationship between a whole and its parts
Aggregation can occur when the contained classes do not have a strong life cycle dependency on the container--essentially, if the container is destroyed, its contents are not
Whole Part
![Page 20: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/20.jpg)
20Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 20Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Compositions
Composition is a stronger variant of the "has a" or association relationship; composition is more specific than aggregation
Composition is a strong life cycle dependency between instances of the container class and instances of the contained class(es) If the container is destroyed, any containees are also
destroyed
![Page 21: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/21.jpg)
21Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 21Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Generalizations
The generalization relationship indicates that one of the two related classes (the supertype) is considered to be a more general form of the other (the subtype). “is a” relationship
Generalizations areused to show an inheritance relationshipbetween two modeling elements (actors, use cases, classes, or packages)
![Page 22: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/22.jpg)
22Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 22Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Realizations
A realization relationship is a relationship between two model elements, in which one model element (the client) realizes the behavior that the other model element (the supplier) specifies Realizes relationships are used to show the relationship
between a class and its interface, between a package and its interface, between a component and its interface, or between a use case and a use case realization
The relationship connects a publicly visible interface (interface class or use case) to the detailed implementation of the interface (class, package, or use case realization)
In other words, this relationship helps separate an interface from its implementation
![Page 23: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/23.jpg)
23Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 23Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Realizations
Cont rolPanel
LCDdisplayLEDindicatorskeyPadCharacterist icsspeakerwirelessInterface
readKeyStroke()decodeKey()displayStatus()lightLEDs()sendControlMsg()
KeyPad
readKeystroke()decodeKey()
<<interface>>
WirelessPDA
KeyPad
MobilePhone
![Page 24: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/24.jpg)
24Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 24Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Dependencies
A dependency is a semantic relationship where a change to the influent or independent modeling element may affect the semantics of the dependent modeling element
Dependency is a model-level relationship and not a run-time relationship -- describing the need to investigate the model definition of the client element for possible changes if the model definition of the supplier element is changed (‘using’ relationship, #include in C++)
Flight Customer
customerdepends on
![Page 25: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/25.jpg)
25Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 25Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Multiplicity
Multiplicity defines how many objects participate in a relationship It is the number of instances of one class related to one
instance of the other class For each association and aggregation, there are two
multiplicity decisions to make: one for each end of the relationship
Multiplicity is represented as a number and a * is used to represent a multiplicity of many
![Page 26: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/26.jpg)
26Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 26Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Multiplicity
![Page 27: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/27.jpg)
27Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 27Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Contents
1. Introduction to UML2. Structural Diagrams
• Class Diagram• Component Diagram
3. Behavioral Diagrams
![Page 28: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/28.jpg)
28Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 28Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
UML Components
In UML 1.1, a component represented implementation items, such as files and executables Unfortunately, this conflicted with the more common use of the
term component," which refers to things such as COM components
Over time and across successive releases of UML, the original UML meaning of components was mostly lost.
In UML 2, components are considered autonomous, encapsulated units within a system or subsystem that provide one or more interfaces Although the UML 2 specification does not strictly state it,
components are larger design units that represent things that will typically be implemented using replaceable" modules
![Page 29: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/29.jpg)
29Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 29Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Component Diagram
A component diagram depicts how a software system is split up into physical components and shows the dependencies among these components
Physical components could be files, headers, link libraries, modules, executables, or packages
Component diagrams can be used to model and document any system’s architecture
![Page 30: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/30.jpg)
30Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 30Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Component Representation
Components are represented as a rectangular classifier with the keyword «component»; optionally the component may be displayed as a rectangle with a component icon in the right-hand upper corner
![Page 31: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/31.jpg)
31Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 31Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Assembly Connector
The assembly connector bridges a component’s required interface (Component1) with the provided interface of another component (Component2); this allows one component to provide the services that another component requires
![Page 32: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/32.jpg)
32Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 32Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Components with Ports
Ports allow for a service or behavior to be specified to its environment as well as a service or behavior that a component requires Ports may specify inputs and outputs as they can operate bi-
directionally The following diagram
details a component with a port for online services along with two provided interfacesorder entry and trackingas well as a required interface payment
![Page 33: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/33.jpg)
33Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 33Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Contents
1. Introduction to UML2. Structural Diagrams3. Behavioral Diagrams Use Case Diagram State Machine Diagram Activity Diagram Communication Diagram Sequence Diagram
![Page 34: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/34.jpg)
34Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 34Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Use Case Diagram
The use case model captures the requirements of a system
Use cases are a means of communicating with users and other stakeholders what the system is intended to do
![Page 35: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/35.jpg)
35Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 35Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Actors
A use case diagram shows the interaction between the system and entities external to the system
These external entities are referred to as actors Actors represent roles which may include human
users, external hardware or other systems
![Page 36: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/36.jpg)
36Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 36Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Use Cases
A use case is a single unit of meaningful work It provides a high-level view of behavior observable to
someone or something outside the system
![Page 37: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/37.jpg)
37Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 37Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Uses Connector
The notation for using a use case is a connecting line with an optional arrowhead showing the direction of control
The uses connector can optionally have multiplicity values at each end, as in the following diagram, which shows a customer may only have one withdrawal session at a time, but a bank may have any number of customers making withdrawals concurrently
![Page 38: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/38.jpg)
38Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 38Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Generalization
Actors can generalize other actors as detailed in the following diagram
![Page 39: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/39.jpg)
39Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 39Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Include Relationship
Use cases may contain the functionality of another use case as part of their normal processing In general it is assumed that any included use case will be
called every time the basic path is run
![Page 40: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/40.jpg)
40Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 40Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Extend Relationship
One use case may be used to extend the behavior of another; this is typically used in exceptional circumstances For example, if before modifying a particular type of
customer order, a user must get approval from some higher authority, then the <Get Approval> use case may optionally extend the regular <Modify Order> use case
![Page 41: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/41.jpg)
41Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 41Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Contents
1. Introduction to UML2. Structural Diagrams3. Behavioral Diagrams Use Case Diagram State Machine Diagram Activity Diagram Communication Diagram Sequence Diagram
![Page 42: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/42.jpg)
42Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 42Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
State Machine Diagram
A state machine diagram models the behaviour of a single object, specifying the sequence of events that an object goes through during its lifetime in response to events
![Page 43: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/43.jpg)
43Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 43Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
States
A state is denoted by a round-cornered rectangle with the name of the state written inside it
The initial state is denoted by a filled black circle and may be labeled with a name
The final state is denoted by a circle with a dot inside and may also be labeled with a name
![Page 44: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/44.jpg)
44Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 44Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Transitions
Transitions from one state to the next are denoted by lines with arrowheads
"Trigger" is the cause of the transition, which could be a signal, an event, a change in some condition, or the passage of time
"Guard" is a condition which must be true in order for the trigger to cause the transition
"Effect" is an action which will be invoked directly on the object that owns the state machine as a result of the transition
![Page 45: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/45.jpg)
45Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 45Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
State Actions
On transition An effect can be associated with the transition
On entry If the target state had many transitions arriving at it, and each
transition had the same effect associated with it, it would be better to associate the effect with the target state rather than the transitions
On exit This can be done by defining
an entry action for the state
![Page 46: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/46.jpg)
46Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 46Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Self Transitions
A state can have a transition that returns to itself, as in the following diagram
This is most useful when an effect is associated with the transition
![Page 47: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/47.jpg)
47Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 47Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Compound States
A state machine diagram may include sub-machine diagrams, as in the example below
![Page 48: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/48.jpg)
48Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 48Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Entry Point
Entry point is used when you won’t want to enter a sub-machine at the normal initial state For example, in the following sub-machine it would be normal
to begin in the "Initializing" state, but if for some reason it wasn’t necessary to perform the initialization, it would be possible to begin in the "Ready" state by transitioning to the named entry point
![Page 49: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/49.jpg)
49Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 49Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Exit Point
In a similar manner to entry points, it is possible to have named alternative exit points The following diagram gives an example where the state
executed after the main processing state depends on which route is used to transition out of the state
![Page 50: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/50.jpg)
50Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 50Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Choice Pseudo-State
A choice pseudo-state is shown as a diamond with one transition arriving and two or more transitions leaving The following diagram shows that whichever state is arrived
at, after the choice pseudo-state, is dependent on the message format selected during execution of the previous state
![Page 51: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/51.jpg)
51Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 51Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Junction Pseudo-State
Junction pseudo-states are used to chain together multiple transitions A single junction can have one or more incoming, and one or
more outgoing, transitions; a guard can be applied to each transition
Junctions are semantic-free A junction which splits an incoming transition into multiple
outgoing transitions realizes a static conditional branch, as opposed to a choice pseudo-state which realizes a dynamic conditional branch
![Page 52: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/52.jpg)
52Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 52Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Junction Pseudo-State
![Page 53: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/53.jpg)
53Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 53Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
History States
A history state is used to remember the previous state of a state machine when it was interrupted The following diagram illustrates the use of history states The example is a state machine belonging to a washing
machine
![Page 54: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/54.jpg)
54Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 54Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Concurrent Regions
A state may be divided into regions containing sub-states that exist and execute concurrently The example below shows that within the state "Applying
Brakes", the front and rear brakes will be operating simultaneously and independently
Notice the use of fork and join pseudo-states, rather than choice and merge pseudo-states. These symbols are used to synchronize the concurrent threads
![Page 55: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/55.jpg)
55Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 55Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Contents
1. Introduction to UML2. Structural Diagrams3. Behavioral Diagrams Use Case Diagram State Machine Diagram Activity Diagram Communication Diagram Sequence Diagram
![Page 56: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/56.jpg)
56Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 56Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Activity Diagram
An activity diagram is used to display the sequence of activities Activity diagrams show the workflow from a start point to the
finish point detailing the many decision paths that exist in the progression of events contained in the activity
They may be used to detail situations where parallel processing may occur in the execution of some activities
Activity diagrams are useful for business modelling where they are used for detailing the processes involved in business activities
![Page 57: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/57.jpg)
57Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 57Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Activity Diagram
![Page 58: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/58.jpg)
58Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 58Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Activities and Actions
An activity is the specification of a parameterized sequence of behaviour An activity is shown as a round-cornered rectangle enclosing
all the actions, control flows and other elements that make up the activity
An action represents a single step within an activity Actions are denoted by round-cornered rectangles
![Page 59: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/59.jpg)
59Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 59Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Action Constraints
Constraints can be attached to an action The following diagram shows an action with local pre-
and post-conditions
![Page 60: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/60.jpg)
60Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 60Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Initial Node and Final Node
An initial or start node is depicted by a large black spot
There are two types of final node: activity and flow final nodes The activity final node indicates that the activity has been
completed
![Page 61: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/61.jpg)
61Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 61Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Flow Final Node
The flow final node indicates that a single flow within an activity is complete
![Page 62: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/62.jpg)
62Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 62Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Objects and Object Flows
An object flow is a path along which objects or data can pass
An object flow is shown as a connector with an arrowhead denoting the direction the object is being passed
![Page 63: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/63.jpg)
63Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 63Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Objects and Object Flows
An object flow must have an object on at least one of its ends
A data store is shown as an object with the «datastore» keyword
![Page 64: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/64.jpg)
64Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 64Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Decision and Merge Nodes
Decision nodes and merge nodes have the same notation: a diamond shape They can both be named The control flows coming away from a decision node will
have guard conditions which will allow control to flow if the guard condition is met
The following diagram shows use of a decision node and a merge node
![Page 65: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/65.jpg)
65Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 65Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Fork and Join Nodes
Forks and joins have the same notation: either a horizontal or vertical bar They indicate the start and end of concurrent threads of
control A join is different from a merge in that the join synchronizes
two inflows and produces a single outflow The outflow from a join cannot execute until all inflows have
been received
![Page 66: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/66.jpg)
66Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 66Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Signals
When an activity sends or receives a message, that activity is called a signal
Input signal• message receiving activity
Output signal• message sending activity
![Page 67: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/67.jpg)
67Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 67Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Time Signal
The time signal is a special kind of a signal and denoted by a hour glass A time signal is generated when a certain amount of time has
passed
![Page 68: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/68.jpg)
68Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 68Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Connector
“Off-page” connectors are used to allow to span multiple pages There are two instances, a target of a flow and a source of a
flow Both instances have the same name The connector indicates that a flow moves from one activity
to another
![Page 69: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/69.jpg)
69Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 69Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Contents
1. Introduction to UML2. Structural Diagrams3. Behavioral Diagrams Use Case Diagram State Machine Diagram Activity Diagram Communication Diagram Sequence Diagram
![Page 70: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/70.jpg)
70Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 70Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Communication Diagram
A communication diagram, formerly called a collaboration diagram, is an interaction diagram that shows similar information to sequence diagrams but its primary focus is on object relationships
On communication diagrams, objects are shown with association connectors between them Messages are added to the associations and show as short
arrows pointing in the direction of the message flow The sequence of messages is shown through a numbering
scheme
![Page 71: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/71.jpg)
71Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 71Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Communication Diagram
![Page 72: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/72.jpg)
72Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 72Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Contents
1. Introduction to UML2. Structural Diagrams3. Behavioral Diagrams Use Case Diagram State Machine Diagram Activity Diagram Communication Diagram Sequence Diagram
![Page 73: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/73.jpg)
73Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 73Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Sequence Diagram
A sequence diagram is a form of interaction diagram which shows objects as lifelines running down the page, with their interactions over time represented as messages drawn as arrows from the source lifeline to the target lifeline Sequence diagrams are good at showing which objects
communicate with which other objects; and what messages trigger those communications
Sequence diagrams are not intended for showing complex procedural logic
![Page 74: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/74.jpg)
74Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 74Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Lifelines
A lifeline represents an individual participant in a sequence diagram A lifeline will usually have a rectangle containing its object
name If its name is "self", that indicates that the lifeline represents
the classifier which owns the sequence diagram
![Page 75: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/75.jpg)
75Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 75Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Sequence Diagrams for Use Cases
Sometimes a sequence diagram will have a lifeline with an actor element symbol at its head This will usually be the case if the sequence diagram is
owned by a use case Boundary, control and entity elements from robustness
diagrams can also own lifelines
![Page 76: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/76.jpg)
76Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 76Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Messages
Messages are displayed as arrows A synchronous message (denoted by the solid arrowhead)
operation does not allow the source object to continue its next step until the target object complete the flow of control
An asynchronous message (denoted by line arrowhead) operation allows the source object to immediately continues with the next step
![Page 77: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/77.jpg)
77Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 77Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Execution Occurrence
A thin rectangle running down the lifeline denotes the execution occurrence, or activation of a focus of control In the previous diagram, there are three execution
occurrences The first is the source object sending two messages and
receiving two replies; the second is the target object receiving a synchronous message and returning a reply; and the third is the target object receiving an asynchronous message and returning a reply
![Page 78: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/78.jpg)
78Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 78Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Self Message
A self message can represent a recursive call of an operation, or one method calling another method belonging to the same object
![Page 79: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/79.jpg)
79Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 79Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Lifeline Start and End
A lifeline may be created or destroyed during the timescale represented by a sequence diagram In the latter case, the lifeline is terminated by a stop symbol,
represented as a cross In the former case, the symbol at the head of the lifeline is
shown at a lower level down the page than the symbol of the object that caused the creation
![Page 80: Introduction to UML (Unified Modeling Language)rtcc.hanyang.ac.kr/sitedata/2015_2_SE_grad/05_a... · · 2015-10-04Introduction to UML (Unified Modeling Language) ... specific than](https://reader031.fdocuments.in/reader031/viewer/2022022507/5ae96b277f8b9ad73f8bd303/html5/thumbnails/80.jpg)
80Real-Time Computing and Communications Lab., Hanyang University
http://rtcc.hanyang.ac.kr 80Real-Time Computing and Communications Lab., Hanyang Universityhttp://rtcc.hanyang.ac.kr
Duration and Time Constraints
By default, a message is shown as a horizontal line. Since the lifeline represents the passage of time down the screen, when modelling a real-time system, or even a time-boundbusiness process, it can be important to consider the length of time it takes to perform actions By setting a duration
constraint for a message, the message will be shown as a sloping line