Interaction Diagrams. Use Cases and Actors INTERACTION MODELING



Similar documents
Using UML Part Two Behavioral Modeling Diagrams

Introduction. UML = Unified Modeling Language It is a standardized visual modeling language.

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

UML Diagram Types. Use Cases do the Following. Use Case Diagram

Process Modeling Notations and Workflow Patterns

3.1 Use Case Diagrams

Types of UML Diagram. UML Diagrams OOAD. Computer Engineering Sem -IV

UML TUTORIALS THE USE CASE MODEL

Aspect Oriented Strategy to model the Examination Management Systems

Object Oriented Programming. Risk Management

[1] [2]

Chapter 19. Activity Diagrams

Communication Diagrams

Object Oriented Software Models

1. Process Modeling. Process Modeling (Cont.) Content. Chapter 7 Structuring System Process Requirements

UML basics. Part II: The activity diagram. The activity diagram's purpose. by Donald Bell IBM Global Services

Compliance and Requirement Traceability for SysML v.1.0a

The Business Process Model

Adapted for a textbook by Blaha M. and Rumbaugh J. Object Oriented Modeling and Design Pearson Prentice Hall, 2005.

Object Oriented Modeling and Design Patterns Advanced State Modeling

Case Study: ATM machine I. Amalia Foka CEID - University of Patras Object Oriented Programming II (C++) Fall

ATM Case Study OBJECTIVES Pearson Education, Inc. All rights reserved Pearson Education, Inc. All rights reserved.

Announcements. SE 1: Software Requirements Specification and Analysis. Review: Use Case Descriptions

A UML Introduction Tutorial

Communications Software Engineering Design Model

The «include» and «extend» Relationships in Use Case Models

ATM Case Study Part 1

BCS Certificate in Systems Modelling Techniques Syllabus

Use Cases. Massimo Felici. Massimo Felici Use Cases c

BPMN by example. Bizagi Suite. Copyright 2014 Bizagi

How To Design Software

LECTURE 11: PROCESS MODELING

Software Engineering. System Models. Based on Software Engineering, 7 th Edition by Ian Sommerville

Tutorial - Building a Use Case Diagram

Chapter 4 Software Lifecycle and Performance Analysis

How To Create A Diagram On Rational Software Development Platform

MTAT Business Process Management (BPM) (for Masters of IT) Lecture 2: Introduction to BPMN

BPMN 2.0 Tutorial. Daniel Brookshier Distinguished Fellow No Magic Inc.

USING UML FOR OBJECT-RELATIONAL DATABASE SYSTEMS DEVELOPMENT: A FRAMEWORK

IRA 423/08. Designing the SRT control software: Notes to the UML schemes. Andrea Orlati 1 Simona Righini 2

Quick Guide Business Process Modeling Notation (BPMN)

Introduction to BPMN

UML Tutorial: Sequence Diagrams.

i. Node Y Represented by a block or part. SysML::Block,

Masters of Science in Software & Information Systems

CPS122 Lecture: State and Activity Diagrams in UML

Information Systems Analysis and Design CSC John Mylopoulos. Software Architectures Information Systems Analysis and Design CSC340

Sequence Diagram Tutorial. From: UML Distilled, Third Edition, Chapter 4 M. Fowler

Business Process Modelling Notation A tutorial

BPMN Business Process Modelling Notation

How To Develop Software

International Journal of Software Engineering and Knowledge Engineering Vol. 11, No. 3 (2001) World Scientific Publishing Company

4.7 Business Process Model and Notation

Week 1: Introduction. Transcript of Week 1 Podcast

6-1. Process Modeling

2 SYSTEM DESCRIPTION TECHNIQUES

Use Case Diagrams. Tutorial

Scenario-based Requirements Engineering and User-Interface Design

Architecture Design & Sequence Diagram. Week 7

MSc programme (induction week) Computer Science Department INTRODUCTION TO UML

Towards an Integration of Business Process Modeling and Object-Oriented Software Development

UNIVERSITY OF SURREY. BSc Programmes in Computing. Level 1 Examination. CS183: Systems Analysis and Design. Time allowed: 2 hours Spring Semester 2006

Object Oriented Design

Designing Real-Time and Embedded Systems with the COMET/UML method

Lab Manual: Using Rational Rose

Applying Use Cases to Microcontroller Code Development. Chris Gilbert Cypress Semiconductor

Topic # 08. Structuring System Process Requirements. CIS Life Cycle and Requirements Structuring Stage

How To Create A Complex Diagram On A Computer Game

UML Activity Diagrams: Versatile Roadmaps for Understanding System Behavior

Section C. Requirements Elicitation

Model Simulation in Rational Software Architect: Business Process Simulation

Writing Use Case Scenarios for Model Driven Development

COSC 3351 Software Design. Recap for the first quiz. Edgar Gabriel. Spring For the 1 st Quiz

Designing a Home Alarm using the UML. And implementing it using C++ and VxWorks

UML Tutorial: Part 1 -- Class Diagrams.

Zen of VISIO Leona Rubin WebTechNY User Group Date: September, 2008

Requirements engineering

Business Process Modeling with BPMN. Dr. Darius Šilingas Head of Solutions Department

System Modeling / Class Diagra Diagr m a Week 6

Analysis and Design with UML

Course Code and Name Year - Semester. Number of marks

Process Modeling using BPMN 2.0

Menouer Boubekeur, Gregory Provan

MEASURING SOFTWARE FUNCTIONAL SIZE FROM BUSINESS PROCESS MODELS

Questions? Assignment. Techniques for Gathering Requirements. Gathering and Analysing Requirements

(Refer Slide Time 00:56)

SemTalk BPMN Tutorial APRIL Tutorial SemTalk 4.3 BPMN Edition for Business Process Analysis

Process Modeling and Process Improvement. Process Modeling

Course Registration Case Study

Requirements / Use Case Specification

Intellect Platform - The Workflow Engine Basic HelpDesk Troubleticket System - A102

CA ERwin Process Modeler Data Flow Diagramming

Business Process Modeling Notation

5 Process Modeling using UML

ICT Business Function Analysis

Modeling Workflow Patterns

Chapter 6. Data-Flow Diagrams

Clinical Domain Analysis Models

WebSphere Business Modeler

OVERVIEW OF THE PROJECT...

Transcription:

Karlstad University Department of Information Systems Adapted for a textbook by Blaha M. and Rumbaugh J. Object Oriented Modeling and Design Pearson Prentice Hall, 2005 INTERACTION MODELING Remigijus GUSTAS Phone: +46-54 700 17 65 E-mail: Remigijus.Gustas@kau.se http://www.cs.kau.se/~gustas/ Interaction Diagrams Both state model and interaction model are needed to describe behavior fully. Interactions can be modeled on different levels of abstraction. Use case, activity and sequence diagrams are used to document interaction. State diagrams and interaction complement each other. 3-2 Use Cases and Actors Use cases represent functionality that a system can provide by interacting with actors. Use case involves a sequence of messages among the system and its actors. An actor is a direct external user of a system, but it is not part of the computerized system. The system responds to requests actors. An actor and use case has a single well-defined purpose (objects and classes serve many different purposes). Modeling the actors helps to define system boundary. 3-3 1

Use Case Diagrams A system involves a set of use cases and a set of actors. A set of use cases represent decomposition of functionality within system boundary. An organizational system part is represented by human actors. Vending Machine buy beverage perform scheduled maintenance make repairs load items Customer Repair technician Stock clerk 3-4 UML Use Case Diagram Notation <<include>> Use Case Actor Boundary Association Include relationship Extend relationship Generalisation <<extend>> 3-5 Guidelines for Use Case Models Determine clear system boundary, Each actor should be focused on a single, coherent purpose, Each use case must provide value to users, Actors and use cases must be related (use case should have an actor and visa versa), Use cases can be decomposed by using special relationships. 3-6 2

What is an Actor? Actor is an external entity that interacts with the system. Most actors represent user roles, but actors can also be external systems. An actor is a role, not a specific user; one user may play many roles, and an actor may represent many users. 3-7 What is a Boundary? A boundary is the dividing line between the system and its environment. Use cases are within the boundary. Actors are outside of the boundary. 3-8 What is a Use Case Connection? A connection is an association between an actor and a use case. Depicts a usage relationship Connection does not indicate data flow 3-9 3

What is an <<extends>> Relationship? The extends relationship adds new incremental behavior to a use case. A (optional) connection between two use cases. Specialized use case extends the general use case. 3-10 3-11 What is an <<include>> Relationship? The include relationship incorporates one use case within the behavior sequence of another use case. A (mandatory) connection between two use cases. Indicates a use case is always used (invoked) by another use case Links to general purpose functions, used by many other use cases 3-12 4

3-13 What is Use Case Generalization? Analogous to generalization among classes. A more specific use cases show variations of more general behavior sequence. A parent use case may be abstract or concrete. Concrete use cases exhibit polymorphism - a more specific use case freely substitutes for a more general use case (overriding). Multiple inheritance is not allowed in use case generalization. 3-14 Customer Securities exchange Stock Brokerage System secure session «include» «include» «include» manage account make trade «include» validate password «extend» limit order trade bonds trade stocks trade options «extend» «extend» «extend» margin trading short sale 3-15 5

Sequence Models The sequence models are used to elaborate use cases. Different kinds of sequence models: Scenarios, Sequence diagrams, Activity diagrams. 3-16 Scenarios Scenario is a sequence of events that occurs during a particular execution (for a system or use case). The scope of scenario can vary (all events or events generated by certain objects). Steps of writing a scenario: Identify objects exchanging messages, Determine the sender and receiver of each message as well as the message sequence, Internal computing operations are added later. 3-17 Scenario between User (John Doe) and Online Stock Broker John Doe logs in. System establishes secure communications. System displays portfolio information. John Doe enters a buy order for 100 shares of GE at the market price. System verifies sufficient funds for purchase. System displays confirmation screen with estimated cost. John Doe confirms purchase. System places order on securities exchange. System displays transaction tracking number. John Doe logs out. System establishes insecure communication. System displays good-bye screen. Securities exchange reports results of trade. 3-18 6

Sequence Diagrams A sequence diagram shows the participants of interaction and the message sequences. Each actor is represented by a lifeline and each message by a horizontal arrow from sender to receiver. Time proceeds from left to right and from top to bottom. Use case requires one or more diagrams to describe the behavior. Diagram can show an entire session or a separate task (rather than repeating the same sequences in many diagrams). 3-19 :Customer :StockBrokerSystem :SecuritiesExchange log in secure communication {verify customer} display portfolio enter purchase data request confirmation confirm purchase display order number logout insecure communication display good bye {verify funds} place order report results of trade Can be included into a separate diagram {execute order} 3-20 Guidelines for Sequence Modeling Define at least one scenario per use case, Abstract the scenarios into graphical descriptions (such as sequence diagrams), Break down complex interactions into smaller parts and define a separate diagram for each of them, Define a diagram for each alternative action (for instance, error condition). 3-21 7

Activity Diagrams An activity diagram defines flow of control with the focus on operations rather than on objects. [success] verify order execute order [failure] send confirmation debit acc ount update on line portfolio send failure n otice settle tr ade close order 3-22 Activities and Events An activity can be decomposed into finer activities or operations. The steps of an activity diagram at the bottom level of abstraction are operations from the state model. The completion of an activity emits a completion event. An arrow from one activity to another indicates that the completion event of the first activity will trigger the second activity. 3-23 Control Conditions Is a mechanism that evaluates a specified condition to determine how processing flow should proceed. Activity diagram notation is using the following control conditions: Decisions (branching), Synchronizations (concurrency) and Guards. If condition is never satisfied, then it might be ill formed. 3-24 8

Initiation verify order Activities Decision execute order [failure] Guard [success] send confirmation debit acc ount update on line portfolio send failure n otice settle tr ade Synchronization Termination close order 3-25 Branching A decision diamond indicates branching into multiple successors (specialization of completion events). All subsequent guard conditions are tested when an activity completes. A particular execution chooses only one path of control. If several arrows enter an activity, then alternate execution paths merge. This situation can be represented by using decision diamond merges several arrows into one exit (generalization of completion events). Logical or of completion events. 3-26 Concurrent Activities Organizations and computer systems can trigger more than one activity at a time. A synchronization bar indicates incoming or outgoing concurrent activities. A fork is used to split control for all outgoing activities (decomposition of completion events). A merge is used to aggregate control from all incoming activities (composition of completion events). Logical and of completion events. 3-27 9

Guidelines for Activity Modeling Activity diagrams are intended to elaborate use cases and should be used by developers to study workflow, not to document software processes, Complex activities should be represented on higher levels of abstraction, If there are guard conditions, at least one must be satisfied when activity completes, Concurrent activities can be completed in any order. For a merge of control, all input activities must be completed. 3-28 Sequence Diagrams with Passive and Active Objects :Transaction :CustomerTable :RateTable compute commission ( ) service level (customer) Passive Objects Active Object commission level calculate commission (level, transaction) commission 3-29 Passive and Active Objects Active objects are appropriate for higher level models. Active objects are independent. They remain active after sending message and can respond to other messages. A passive object is not activated until it has been called. Once execution of the operation completes and control returns to the caller, the passive object remains inactive. Lifeline is the entire period of object existence. Activation (thin rectangle) shows the time period during which a call is being processed. 3-30 10

Return arrows can be suppressed, because their location is implicit. :Transaction :Customer :Rate compute commission ( ) get service Level (customer) commission level calculate commission (level, transaction) commission 3-31 Transient Objects Creation operation is shown by placing the object symbol at the head of the arrow. X marks the end of the life cycle of an object. if the object destroys itself and returns control, then X is placed at the tail of return arrow. X can be placed at the head of the call arrow that destroys the object. Note: The filled arrowhead indicates a call (as opposed to the stick arrowhead for asynchronous signal). 3-32 Diagram with Transient Object objecta objectb operatione (c, d) createc (arg) objectc operatione (m, n) resultt {execute order} resultv 3-33 11

Return arrows can be suppressed, removal operation can replace X. objecta objectb operatione (c, d) createc (arg) objectc operatione (m, n) removec (arg) resultt resultv 3-34 Sending and Receiving Signals UML shows sending signals as a convex pentagon and receiving signals as concave pentagon. execute boot sequence accept user login request validation wait for response receive confirmation ready network 3-35 Swimlanes Placing an activity within a swimlane indicates that it is performed by a person with the specific role or at the specific department in an organization. Flight attendant Ground crew Catering clean trash add fuel load food and drinks 3-36 12

Object Flows Activities can use or produce object in a particular state. Input and output arrows imply a control flow (it is unnecessary to draw control flows in object flow diagrams. :Airplane [at gate] leave gate :Airplane [taxiing] take off :Airplane [in flight] :Airplane [at gate] park at gate :Airplane [taxiing] landing 3-37 13