Object-Interaction Diagrams: Sequence Diagrams UML

Similar documents
Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

Object-Oriented Modeling. Sequence Diagram. Slides accompanying Version 1.0

The learning objectives of this chapter are the followings. At the end of this chapter, you shall

CS 370 REVIEW: UML Diagrams D R. M I C H A E L J. R E A L E F A L L

Interaction Modelling: Sequence Diagrams

Software Specification 2IX20

What is a Class Diagram? A diagram that shows a set of classes, interfaces, and collaborations and their relationships

What is a Class Diagram? Class Diagram. Why do we need Class Diagram? Class - Notation. Class - Semantic 04/11/51

Meltem Özturan

Object Interaction Sequence Diagrams

Unified Modeling Language (UML) Object Diagram and Interaction Diagrams

UML Component Diagrams A.Y 2018/2019

Interactions A link message

Lecture 21 Detailed Design Dynamic Modeling with UML

Unified Modeling Language

UML Behavioral Models

Applying UML & Patterns (3 rd ed.) Chapter 15

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

UML Sequence Diagrams

Chapter 2, Modeling with UML: UML 2 Hightlights

Sequence Diagram. r: Register s: Sale

Sequence Diagram. A UML diagram used to show how objects interact. Example:

Sequence Diagrams. Sequence Diagrams. Version Sequence Diagrams are. History. simple powerful readable used to describe interaction sequences

UML Essentials Dynamic Modeling

Introduction to Unified Modelling Language (UML)

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

Unit 5: Sequence Diagrams

UML Sequence Diagrams for Process Views

Advanced Interaction

What's New in UML 2.0

UML- a Brief Look UML and the Process

Object Oriented Methods with UML. Lecture -4

Ali Khan < Project Name > Design Document. Version 1.0. Group Id: S1. Supervisor Name: Sir.

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

CSE 308. UML Sequence Diagrams. Reading / Reference.

CSE 403. UML Sequence Diagrams. Reading: UML Distilled Ch. 4, by M. Fowler

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

KF5008 Program Design & Development. Lecture 3 Sequence Diagrams

System Sequence Diagrams. Based on Craig Larman, Chapter 10 and Anuradha Dharani s notes

MSc programme (induction week) Department of Informatics INTRODUCTION TO UML

UML 2.0 UML 2.0. Scott Uk-Jin Lee. Division of Computer Science, College of Computing Hanyang University ERICA Campus

Refining UML specifications. - the STAIRS method. Ragnhild Kobro Runde. Joint work with Ketil Stølen and Øystein Haugen. Ragnhild Kobro Runde

Operating System. Chapter 3. Process. Lynn Choi School of Electrical Engineering

3: Modeling Behavior with UML Sequence Diagrams

CPS221 Lecture: Threads

UML (Unified Modeling Language)

7. UML Sequence Diagrams Page 1 of 1

UNIT-IV BASIC BEHAVIORAL MODELING-I

In this case, the behavior of a single scenario

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 8: Modelling Interactions and Behaviour

Tool Support for Design Inspection: Automatic Generation of Questions

Actor-Based Concurrency: Implementation and Comparative Analysis With Shared Data and Locks Alex Halter Randy Shepherd

Modeling with Activity Diagram

Chapter 15 UML Interaction Diagrams. Larman, C. Applying UML and Patterns. 3rd Ed. Ed. Prentice-Hall: 2005.

Modeling Dynamic Behavior

State Machine Diagrams

Object-oriented design. More UML

Unified Modeling Language (UML)

Course: Operating Systems Instructor: M Umair. M Umair

SE Assignment III. 1. List and explain primitive symbols used for constructing DFDs. Illustrate the use of these symbols with the help of an example.

Process Concept Process Scheduling Operations On Process Inter-Process Communication Communication in Client-Server Systems

Specifying Precise Use Cases with Use Case Charts

Model Based Software Timing Analysis Using Sequence Diagram for Commercial Applications

Sample Questions. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

What s Next. INF 117 Project in Software Engineering. Lecture Notes -Spring Quarter, Michele Rousseau Set 6 System Architecture, UML

Sequence Diagrams. Dan Fleck. Coming up: Interaction Diagrams

Reminder from last time

SWE 621: Software Modeling and Architectural Design. Lecture Notes on Software Design. Lecture 8 Architectural Design of Distributed Applications

BUILDING BLOCKS. UML & more...

Developing Shlaer-Mellor Models Using UML

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Unit Wise Questions. Unit-1 Concepts

COMP 354: INTRODUCTION TO SOFTWARE ENGINEERING

Coordination and Agreement

Requirements Checking for Object-Oriented Software Design with different Unified Modelling Language (UML) notations

Processes and Threads

STATE MACHINES. Figure 1: State Machines

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

Distributed Systems. coordination Johan Montelius ID2201. Distributed Systems ID2201

2.0.3 attributes: A named property of a class that describes the range of values that the class or its instances (i.e., objects) may hold.

Coordination and Agreement

Test Case Generation for Concurrent System using UML Combinational Diagram

JOURNAL OF OBJECT TECHNOLOGY

UNIT-4 Behavioral Diagrams

Distributed minimum spanning tree problem

IT 540 Operating Systems ECE519 Advanced Operating Systems

UP Requirements. Software Design - Dr Eitan Hadar (c) Activities of greater emphasis in this book. UP Workflows. Business Modeling.

APPENDIX M INTRODUCTION TO THE UML

Today: Synchronization. Recap: Synchronization

Lecture 17: (Architecture V)

PragmaDev. change request. Emmanuel Gaudin. PragmaDev ITU-T SG17 change request Grimstad June 24,

Sequence Diagrams. Chapter 4

Question Sheet There are a number of criticisms to UML. List a number of these criticisms.

Editor. Analyser XML. Scheduler. generator. Code Generator Code. Scheduler. Analyser. Simulator. Controller Synthesizer.

LINUX INTERNALS & NETWORKING Weekend Workshop

Control Abstraction. Hwansoo Han

High Performance Computing. University questions with solution

Midterm Exam. October 20th, Thursday NSC

Transcription:

Object-Interaction Diagrams: Sequence Diagrams UML

Communication and Time In communication diagrams, ordering of messages is achieved by labelling them with sequence numbers This does not make temporal ordering easy to follow.

Sequence Diagrams Sequence diagrams make temporal ordering explicit. However, they do not contain explicit link information (so the correspondence with the class diagram is not as explicit as with communication diagrams).

A closer look

Components of Sequence Diagrams Vertical axis: time, increasing downwards. Objects that exchange messages in a behaviour trace are shown on the horizontal axis, at the top. With every object is a vertical dashed line, which depicts an object's lifeline. Over the object's active lifetime, the lifeline is a rectangle, which depicts when an object is active (i.e., has control). The rectangle's size is proportional to how long the object is active. Explicit time unit may be added. Arrows depict messages from a sender object to a target object and the message is written along the arrow.

Alt: Alternative fragment for conditional logic expressed in the guards. Loop: Loop fragment while guard is true. Break: If guard is true, execute this fragment and jump to end of parent fragment. Opt: Optional fragment that executes if guard is true. Par: Parallel fragments that execute in parallel. Critical: Critical region within which only one thread of control active at a time. No concurrent region (e.g.: par) may execute at the same time. Ref: Reference to another diagram. Assert: This behaviour is the only valid at that point. Seq: Weak sequencing of messages; no order of reception. Types of Fragments

Synchronous vs. Asynchronous If you order a piece of equipment, and the salesman goes in the back of the store to get it, do you wait for the piece of equipment? If you order a piece of equipment, and the salesman tells you it is backordered, and will arrive next week, do you wait for the piece of equipment?

Synchronous Messages The sender object waits until target object finishes its proccessing of the message. Target object processes only one message at a time. Consequently, this behavior represents a single thread of control. only one object is active at any time

Asynchronous Messages Sender object does not wait until target object finishes its processing of the message (execution of the called method). Target object may accept many messages at a time. Consequently, this behavior requires multiple threads of control. many objects can be active at any time this is also known as concurrency

Depicting Asynchronous Messages Instead of using a filled arrowhead, we use an open arrowhead (in both communication and sequence diagrams). In sequence diagrams we may have two objects active at the same time (box). The sender object remains active after sending a message. The target object becomes active as well. If the target object can accept multiple messages, how does it handle them?

Concurrency If target object's method implements threading, It can thread itself to handle messages. This is called operation level concurrency. If target object itself implements threading, It can thread itself to handle messages. This is called object level concurrency. If objects don't implement any threading but the system is concurrent, objects must implement some way of handling messages: system level concurrency. Refuse message(s) if busy Interrupt current executing message and start on new message Queue message(s) for later processing (can be priority queue)

Message Priorities One way to deal with asynchronous messages is to queue them. That way, only one of them is processed at a time. But what happens if one message is more important than others. You can use priority levels to determine the order messages are processed. What are the dangers of this?

Callback Mechanism Uses asynchronous messages. A subscriber object o1 is interested in an event e that occurs in o2. o1 registers interest in e by sending a message (that contains a reference to itself) to o2 and continues its execution. When e occurs, o2 will callback asynchronously to o1 (and any other subscribers).

Callback (but not to self) illustrated

Object creation/destruction Sequence diagrams use A special method sent to the object (not its lifeline) to denote object creation. an X to symbolize the end-of-life of an object. In garbage-collected languages, nothing needs to be done. However, in other languages, such as C++, the memory must be freed.

Broadcast Similar to iterative messaging, broadcast allows you to send a message to multiple objects. However, contrary to iterative messaging, no references are required. A broadcast is sent to all the objects in the system. If only a specific category of objects is targeted, we call this narrowcast.