In this case, the behavior of a single scenario

Similar documents
UML Sequence Diagrams

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

Sequence Diagrams. Chapter 4

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

Software Specification 2IX20

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

Introduction to Unified Modelling Language (UML)

Unified Modeling Language

CSE 308. UML Sequence Diagrams. Reading / Reference.

Object Oriented Methods with UML. Lecture -4

Object Interaction Sequence Diagrams

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

Object-Interaction Diagrams: Sequence Diagrams UML

Chapter 2, Modeling with UML: UML 2 Hightlights

SEQUENCE DIAGRAMS A sequence diagram captures the behavior of a single scenario. The diagram shows a number of example objects and the messages that a

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

Lecture 21 Detailed Design Dynamic Modeling with UML

3: Modeling Behavior with UML Sequence Diagrams

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

Modeling System Behavior. Events Scenarios Sequence Diagrams Collaboration Diagrams

CS211 Lecture: Modeling Dynamic Behaviors of Systems; Interaction Diagrams in UML

UML Behavioral Models

KF5008 Program Design & Development. Lecture 3 Sequence Diagrams

Unified Modeling Language (UML) Object Diagram and Interaction Diagrams

Sequence Diagram. r: Register s: Sale

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

CS211 Lecture: Modeling Dynamic Behaviors of Systems; Interaction Diagrams and Statecharts Diagrams in UML

UML (Unified Modeling Language)

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

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

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

CSSE 374: UML Activity Diagrams. Shawn Bohner Office: Moench Room F212 Phone: (812)

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

public int calculatedamage() { // Generate and return the damage inflicted on ship }

Software Engineering. Page 1. Objectives. Object-Behavioural Modelling. Analysis = Process + Models. Case Study: Event Identification

Specifying Precise Use Cases with Use Case Charts

3.0 Object-Oriented Modeling Using UML

Unit 5: Sequence Diagrams

Selection Control Structure CSC128: FUNDAMENTALS OF COMPUTER PROBLEM SOLVING

Interaction Modelling: Sequence Diagrams

Recap : UML artefacts. Black Box Requirements. Functional Specification. System. System. Test. Design. System. System. Development.

Text Input and Conditionals

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

Meltem Özturan

Use Parametric notation. Interpret the effect that T has on the graph as motion.

Unified Modeling Language (UML)

Modeling Dynamic Behavior

Modeling Dynamic Behavior

Unit #3: Recursion, Induction, and Loop Invariants

Chapter 1: Function Sense Activity 1.2 & 3

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

Topic 3 Unified Modeling Language UML. Objective: Student will use UML to represent relationshiops between objects, its structure and dynamics.

LL(k) Parsing. Predictive Parsers. LL(k) Parser Structure. Sample Parse Table. LL(1) Parsing Algorithm. Push RHS in Reverse Order 10/17/2012

ETCS requirements specification and validation: the methodology

03 Features of C#, Part 2. Jerry Nixon Microsoft Developer Evangelist Daren May President & Co-founder, Crank211

More on control structures

Software Design and Analysis CSCI 2040

BASICS OF UML (PART-2)

GEDI (Graco Extranet for Distributor Information) Order File Transfer Conduct Your Graco Business Online at in GEDI

Today s Agenda UML. CompSci 280 S Introduction to Software Development. 1.Introduction UML Diagrams. Topics: Reading:

1.7 Limit of a Function

CS 139 Practice Midterm Questions #2

9. f(x) = x f(x) = x g(x) = 2x g(x) = 5 2x. 13. h(x) = 1 3x. 14. h(x) = 2x f(x) = x x. 16.

Introduction to UML p. 1 Introduction to the Object-Oriented Paradigm p. 1 What Is Visual Modeling? p. 6 Systems of Graphical Notation p.

Music and Videos. with Exception Handling

UML part I. UML part I 1/41

Principles of Software Construction: Objects, Design and Concurrency. Just enough UML. toad

Examples of attributes: values of evaluated subtrees, type information, source file coordinates,

9.1 Linear Inequalities in Two Variables Date: 2. Decide whether to use a solid line or dotted line:

Introduction to UML Diagrams

Excellence with Excel: Quiz Questions Module 6 Graphs and Charts

Activity Guide - Will it Crash?

Requirements Gathering using Object- Oriented Models UML Class Diagram. Reference:

BPMN2BPEL transformation with Fujaba - a Case Study

CPSC 211, Sections : Data Structures and Implementations, Honors Final Exam May 4, 2001

Battle of Desktop Publishing Programs

Lexical and Syntax Analysis

Semantics Preservation of Sequence

UML Sequence Diagrams for Process Views

Recap Randomized Algorithms Comparing SLS Algorithms. Local Search. CPSC 322 CSPs 5. Textbook 4.8. Local Search CPSC 322 CSPs 5, Slide 1

1.2 Reflections and Stretches

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

CS 161 Intro to CS I. Finish Pointers/Start Recursion

INF 111 / CSE 121: Announcements Quiz #3- Thursday What will it cover?

Lexical and Syntax Analysis. Top-Down Parsing

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

CPSC 219 Extra review and solutions

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

CS 126 Lecture P1: Introduction to C

Hippo Software BPMN and UML Training

Principles of Automated Reasoning and Decision Making

Systems Analysis and Design in a Changing World, Fourth Edition

On to Iteration 3, and Activity Diagrams CSSE 574: Session 6, Part 1

SEEM4570 System Design and Implementation Lecture 11 UML

Test Case Generation for Concurrent System using UML Combinational Diagram

Selection of UML Models for Test Case Generation: A Discussion on Techniques to Generate Test Cases

Software Service Engineering

UML Component Diagrams A.Y 2018/2019

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

Transcription:

CPSC 491 UML Sequence s UML Sequence s One of many UML notations for modeling behavior A specific type of interaction diagram In this case, the behavior of a single scenario Usually a single call on an object Where the call involves interactions That is, more calls on other objects (Can also include multiple initial calls )

UML Sequence s For example: Calculate the price of an order Get the product prices of the order Determine customer discounts Get shipment costs and so on Sequence diagrams are a similar to drawing function call (or activation) stacks Simple Example of a UML Sequence More generally participants in the sequence diagram Objects Object lifelines

Simple Example of a UML Sequence The first message Doesn t have a participant that sent it The activation bar of () Shows when the operation is active in the interaction (on the call stack) Simple Example of a UML Sequence () calls on the aproduct object A message

Simple Example of a UML Sequence getdiscounts() getdiscounts() is then called on the acustomer object Simple Example of a UML Sequence getdiscounts() getshippinglocation() getshippinglocation() is then called on the acustomer object zipcode Here we show that the message returns a zipcode

Simple Example of a UML Sequence getdiscounts() getshippinglocation() zipcode Finally, the shipping cost is determined from the Product (based on the zipcode) getshippingcost(zipcode) Details: Self calls You can show calls on the object itself ( self-calls ) acustomer : Customer getshippinglocation() getzipcode()

Details: Participant Creation/Deletion You can show object construction / destruction acart : ShoppingCart addtocartandcheckout() new addproduct(p) anorder : Order placeorder() saveorder() close Details: Control-Flow Often it is nice to show (some) control-flow Iteration, Conditionals A general observation Not what sequence diagrams are good at Often better to use a different type of diagram or just write the code (or psuedocode) There are two ways to show control-flow Interaction frames (a newer UML 2 construct) Iteration markers and guards (UML 1)

Interaction Frames: Loops anorder : Order Guard aproduct : Product Interaction frame loop [foreach product] etc. Interaction Frames: Alternatives anorder : Order aproduct : Product loop [foreach product] alt [if price > 1000] usespecialshipping() [else] usestandardshipping() Guards

Interaction Frames Common operators for interaction frames alt opt par loop neg choose from alternative fragments (if-else) do optional fragment if condition holds (if-then) execute each fragment in parallel execute fragment multiple times based on guard the fragment shows an invalid (negative) interaction Iteration markers and guards ( old syntax) anorder : Order aproduct : Product Iteration marker * * [foreach product] This approach is more widely used Alternative [if price > 1000] usespecialshipping() [else] usestandardshipping() Guard Guard

UML Sequence s Good for 1. Showing basic calls between objects 2. Showing what role objects play in the interaction 3. Determining needed operations of objects and why 4. Going from stories to designs Exercise Sketch a sequence diagram for your project Start from a user story Pick operations with interactions among classes Draw at least two sequence diagrams for some interesting behavior of your system