OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  1998-1999 Rational Software, all rights reserved 1 Interaction Diagrams.

Slides:



Advertisements
Similar presentations
Introduction to Rational Rose 2000 v6.5 Copyright © 1999 Rational Software, all rights reserved 1 Rational Rose 2000 Interaction Diagrams.
Advertisements

Interaction Diagram Notation From Chapter 15 of Craig Larman, Applying UML and Patterns John Dalesandro.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/20 Interaction Diagrams.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Summary Class responsibility cards can be used to help allocate responsibilities between different classes. The use of stereotype classes, such as entity,
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
Uml and Use Cases CS 414, Software Engineering I Mark Ardis Rose-Hulman Institute January 9, 2003.
SwE 313 Case Study Registration System.
Close Registration Brief Description
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
© 2005 Prentice Hall4-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Object Collaborations. Objectives: Object Interaction (cont.) You will be able to:  Use sequence diagrams to detail object interactions.
Dynamic modeling using UML
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
Sample Analysis Model. Example: Sequence Diagram –“Richer Sample.” : Student : RegisterForCoursesForm : RegistrationController : Schedule : Student :
Detail Design: Use-Case Design
Use Case Analysis – continued
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
OOAD – Dr. A. Alghamdi Mastering Object-Oriented Analysis and Design with UML Module 6: Use-Case Analysis Module 6 - Use-Case Analysis.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
® IBM Software Group © 2006 IBM Corporation Writing Good Use Cases Module 4: Detailing a Use Case.
CS3773 Software Engineering
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Shanghai Jiao Tong University 上海交通大学软件工程中心 Object Oriented Analysis and Design Use-Case Design.
Interaction Modeling Interaction model describes how objects interact to produce useful results. Interactions can be modeled at different levels of abstraction:
1 On to Object Design Chapter 14 Applying UML and Patterns.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1 Building Analysis Classes.
Copyright © Hsiao-Lan Wei All Rights Reserved Design Model Interaction diagram.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
Introduction to Rational Rose 2000 v6.5 Copyright © 1999 Rational Software, all rights reserved 1 Rational Rose 2000 Class Diagrams.
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
1 IBM Software Group ® Mastering Object-Oriented Analysis and Design with UML 2.0 Module 6: Use-Case Analysis.
1 Detail Design: Use-Case Design Background on Use Case Design Have ‘done’ Architectural Design; You know the major (eleven) precepts of good design.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Information Systems Engineering Interaction Diagrams: Sequence Diagram Collbortion Diagram.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Drawing System Sequence Diagrams
Use Case Diagram The purpose is to communicate the system’s functionality and behaviour to the customer or end user. Mainly used for capturing user requirements.
ASU Course Registration System System Analysis Communication Diagram Use Case: Select Courses to Teach.
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Sequence Diagrams CSIS3600. Sequence Diagrams A sequence diagram shows an interaction arranged in time sequence. In particular, it shows the objects participating.
UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which.
1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Module 5: Interaction Diagrams.
Page 1  Copyright © 1997 by Rational Software Corporation Putting the UML to Work The ESU University wants to computerize their registration system –
Object Oriented Analysis and Design using the UML Use-Case Analysis Adapted by Dr. Spiegel from Slides Provided by Rational Software.
UML - Development Process 1 Software Development Process Using UML.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1 Use Case Analysis – continued Control Classes.
Page 1  Copyright © 1997 by Rational Software Corporation Putting the UML to Work The ESU University wants to computerize their registration system –
More on UML 1. 1.Use-case diagram 2.Class diagram [Object diagram] (static) 1.1 Domain/analysis model – of reality 1.2 Design model – of decisions 3.
Unified Modeling Language. What is UML? Standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems,
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1 Use Case Analysis – Part 4 Analysis Mechanisms.
GOVT. ENGINEERING COLLEGE, AJMER. A SEMINAR PRESENTATION ON UNIFIED MODELING LANGUAGE(UML) SUBMITTED TO:-PRESENTED BY:- Dr. REENA DADHICHPALLAVI VASHISTHA.
Systems Analysis and Design in a Changing World, Fourth Edition
UML Diagrams By Daniel Damaris Novarianto S..
UML Diagrams Jung Woo.
UML SEQUENCE AND CLASS DIAGRAMS
Princess Nourah bint Abdulrahman University
Princess Nourah bint Abdulrahman University
UML Interaction diagrams
Use Case Analysis – continued
Use Case Analysis – continued
Presentation transcript:

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1 Interaction Diagrams

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 2 1: PerformResponsibility Client Object Supplier Object Message :Client:Supplier Focus of Control An object is shown as a vertical dashed line called a lifeline. Lifeline represents the existence of object at a particular time. An object symbol is drawn at the head of the life line. Name of object & its class are separated by a colon & underlined. Reflexive Message Object Lifeline 1.1: PerformAnother Responsibility The Anatomy of Sequence Diagrams Hierarchical Message Numbering A Sequence Diagram describes a pattern of interaction among objects, arranged in a chronological order; it shows the objects participating in the interaction and the messages they send. Sample Script

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 3 The Anatomy of Sequence Diagrams – the Message  A message is a communication between objects that conveys information with the expectation that activity will ensue.  A message is shown as a horizontal solid arrow from the lifeline of one object to the lifeline of another object.  For a reflexive message, the arrow starts and finishes on the same lifeline.  The arrow is labeled with the name of the message, and its parameters.  The arrow may also be labeled with a sequence number.

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 4 Anatomy of Sequence Diagrams – Focus of Control  Focus of control represents the relative time that the flow of control is focused in an object, thereby representing the time an object is directing messages.  Focus of control is shown as narrow rectangles on object lifelines.  Hierarchical numbering bases all messages on a dependent message.  The dependent message is the message whose focus of control the other messages originate in.  For example, message 1.1 depends on message 1.  Scripts describe the flow of events textually.

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 5  Anatomy of Sequence Diagram  The next example shows the object interactions to support the Register for Courses use case, Create a Schedule subflow. Some responsibility allocation rationale is as follows:  The RegisterForCoursesForm knows what data it needs to display and how to display it. It does not know where to go to get it. That’s one of the RegistrationController’s responsibilities.  Only RegisterForCoursesForm interacts with Student actor.  The RegistrationController understands how Students and Schedules are related.  Only the CourseCatalogSystem class interacts with the external legacy Course Catalog System.  Note inclusion of the actors. This is important as it explicitly models what elements communicate with the “outside world”.

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 6 Example: Sequence Diagram – a “richer’ example… : Student : RegisterForCoursesForm : RegistrationController : Schedule : Student : Course Catalog : CourseCatalogSystem A list of the available course offerings for this semester are displayed Student wishes to create a new schedule 1. // create schedule( ) 1.2. // display course offerings( ) 1.1. // get course offerings( ) // get course offerings(forSemester) 1.3. // display blank schedule( ) At this, point the Submit Schedule subflow is executed.  Note requests for service from Actor! (ahead) 2. // select four primary and two alternate offerings( ) 2.1. // create schedule with offerings( ) // create with offerings( ) A blank schedule is displayed for the students to select offerings // add schedule(Schedule) // get course offerings( ) What kinds of classes are these????? Know this. Sequence Diagram to Create a New Schedule…(from a Use Case)

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 7 Continuing…(two slides forward…)  Next is the interaction diagram for the Submit Schedule subflow.  It describes what occurs when a Student requests that an entered schedule be actually submitted.  When a Schedule is submitted, an attempt is made to register the student for all selected primary courses one at a time, as you will see in the sequence diagram ahead...  Note the allocation of responsibility.  The Schedule has been given the responsibility for performing all of the processing associated with submitting a Schedule. (shown ahead in Sequence Diagram)  It orchestrates a series of checks (Student has pre- requisites, the course offering is still open, and the Student does not have any schedule conflicts), prior to enrolling the Student in the Course Offering.. These methods (responsibilities) must be available in all Schedule object

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 8 Continuing – adding a new class…(next slide)  Note the addition of the new class, PrimaryScheduleOfferingInfo.  This class was needed to maintain the status of each particular Course Offering on a Schedule (as well as the associated grade – grade was added later).  This was added to assist in locking in courses. Responsibilities were not germane to an existing class, so this one was created to help.  This will be discussed in more detail later.

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 9 Example: Sequence Diagram (cont.) :CourseOffering : Student : RegisterForCoursesForm : RegistrationController : Schedule : Student : PrimaryScheduleOfferingInfo Repeat for all primary course offerings. An attempt is made to register the student for all selected course Offerings one at a time!!! (See loop) 1. // submit schedule( ) 1.1. // submit schedule( ) // submit( ) // still open?( ) // add student(Schedule) // has pre-requisites(CourseOffering) // any conflicts?( ) // is selected?( ) // mark as enrolled in( ) // save( ) [ has pre-requisites, course offering open, and no schedule conflicts ] [ is selected ] Note the loop in the Sequence Diagram… This sequence diagram is for Submit Schedule Now actor wishes to submit the schedule…

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 10 1: PerformResponsibility Client Object Supplier Object Message Link :Client:Supplier The Anatomy of Collaboration Diagrams A collaboration diagram describes a pattern of interaction among objects. It shows objects participating in the interaction by their links to each other and the messages that they send to each other. An object is represented in three ways: Objectname:Classname, Objectname, and :Classname A link is a relationship among objects across which messages can be sent. In a collaboration diagram, a link is shown as a solid line between two objects. A link can be an instance of an association, or it can be anonymous – meaning that its association is unspecified.

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 11 The Anatomy of Collaboration Diagrams - more  A message is a communication between objects that conveys information with the expectation that activity will ensue. (back one to slide)  In collaboration diagrams, a message is shown as a labeled arrow placed near a link.  This means that the link is used to transport, or otherwise implement the delivery of the message to the target object.  The arrow points along the link in the direction of the target object (the one that receives the message).  The arrow is labeled with the name of the message, and its parameters.

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 12 The Anatomy of Collaboration Diagrams - more  The arrow may also be labeled with a sequence number to show the sequence of the message in the overall interaction.  Sequence numbers are often used in collaboration diagrams, because they are the only way of describing the relative sequencing of messages.  (A message can be unassigned, meaning that its name is a temporary string that describes the overall meaning of the message, like //get_schedule(). You can later assign the message by specifying the operation of the message's destination object.  The specified operation will then replace the name of the message.  Frequently locked in upon further analysis

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 13 Example: Collaboration Diagram (one subflow…) : Student : RegisterForCoursesForm : RegistrationController : Schedule :Student : CourseCatalogSystem 1.2. // display course offerings( ) 1.3. // display blank schedule( ) : Course Catalog 1. // create schedule( ) 2. // select four primary and two alternate offerings( ) 1.1. // get course offerings( ) 2.1. // create schedule with offerings( ) // create with offerings( ) // get course offerings(forSemester ) // add schedule(Schedule) // get course offerings( ) This example shows the collaboration of objects to support the Register for Courses use case: Create a Schedule subflow. It is the “collaboration diagram equivalent” of the sequence diagram shown earlier.

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 14 Example: Collaboration Diagram (second subflow) : CourseOffering : Student : RegistrationController : Schedule : Student : PrimaryScheduleOfferingInfo // any conflicts?( ) : RegisterForCoursesForm 1. // submit schedule( ) 1.1. // submit schedule( ) // submit( ) // save( ) // still open?( ) // add student(Schedule) // is selected?( ) // mark as enrolled in( ) // has pre-requisites(CourseOffering) The example below shows the collaboration of objects to support the Register for Courses use case, Submit Schedule subflow. It is the “collaboration diagram equivalent” of the sequence diagram shown earlier. Note all the responsibilities of Schedule objects…

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 15 One Interaction Diagram Not Good Enough  You should model most of the flows of events to make sure that all requirements on the operations of the participating classes are identified.  Start with describing the basic flow, which is the most common or most important flow of events.  Then describe variants such as exceptional flows.  You do not have to describe all the flows of events, as long as you employ and exemplify all operations of the participating objects.  Very trivial flows can be omitted, such as those that concern only one object.

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 16 Exception Flows  Examples of exceptional flows include the following.  Error handling. What should the system do if an error is encountered?  Time-out handling. If the user does not reply within a certain period, the use case should take some special measures  Handling of erroneous input to the objects that participate in the use case (e.g., incorrect user input)  Examples of optional flows include the following: The actor decides-from a number of options-what the system is to do next The subsequent flow of events depends on the value of stored attributes or relationships The subsequent flow of events depends on the type of data to be processed  Can use either collaboration and sequence diagrams.

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 17 Alternate Flow 4Alternate Flow 5Alternate Flow n Alternate Flow 1Alternate Flow 2Alternate Flow 3 AF1 AF2 AF3 Basic Flow One Interaction Diagram Not Good Enough Can all be shown visually with an Activity Diagram for that Use Case

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 18 Collaboration Diagrams Vs Sequence Diagrams Same information expressed in different ways…  Collaboration Diagrams  Show relationships in addition to interactions  Better for visualizing patterns of collaboration  Better for visualizing all of the effects on a given object  Easier to use for brainstorming sessions  Sequence Diagrams  Show the explicit sequence of messages  Better for visualizing overall flow  Better for real-time specifications and for complex scenarios

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 19 More on Collaboration Diagrams  Collaboration diagrams  emphasize the structural collaboration of a society of objects and  provide a clearer picture of the patterns of relationships and control that exist among the objects participating in a use case.  Collaboration diagrams show more structural information (i.e., the relationships among objects).  Collaboration diagrams  better for understanding all the effects on a given object and for procedural design. (your logic is there!!)

OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 20 More on Sequence Diagrams  Sequence diagrams  show the explicit sequence of messages and  are better for real-time specifications and for complex scenarios.  A sequence diagram includes chronological sequences, but does not include object relationships.  Sequence numbers are often omitted in sequence diagrams, in which the physical location of the arrow shows the relative sequence.  On sequence diagrams, the time dimension is easier to read, the operations and parameters are easier to present, and the larger number of objects are easier to manage than in collaboration diagrams.