Chapter 9: Object Interaction Modeling

Slides:



Advertisements
Similar presentations
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Advertisements

Systems Analysis and Design in a Changing World, Fourth Edition
UI Standards & Tools Khushroo Shaikh.
Introduction to Software Engineering Dr. Basem Alkazemi
Deriving a Design Class Diagram Yonglei Tao 1. Responsibilities  Doing  do something itself  initiate action in other objects  control and coordinate.
Object Interaction Modeling
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.
CMPT 275 Software Engineering
Chapter 7: The Object-Oriented Approach to Requirements
Software Development Process
Use Cases Yonglei Tao.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
The Unified Process Object Interaction Modeling and Design Class Diagram 中国科学技术大学软件学院 孟宁 2012年10月.
Introduction to Sequence Diagrams
Chapter 10: Applying Responsibility Assignment Patterns
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Chapter 8: Actor-System Interaction Modeling
1 CMPT 275 Phase: Design. Janice Regan, Map of design phase DESIGN HIGH LEVEL DESIGN Modularization User Interface Module Interfaces Data Persistance.
From Use Cases to Test Cases 1. A Tester’s Perspective  Without use cases testers will approach the system to be tested as a “black box”. “What, exactly,
Putting together a complete system Chapter 10. Overview  Design a modest but complete system  A collection of objects work together to solve a problem.
Chapter 14. Activity Modeling for Transformational Systems
1 Sub-Phase Low Level Design (cont). Janice Regan, Map of design phase DESIGN HIGH LEVEL DESIGN Modularization User Interface Module Interfaces.
Chapter 6 Use Cases. Use Cases: –Text stories Some “actor” using system to achieve a goal –Used to discover and record requirements –Serve as input to.
Key Takeaway Points A use case is a business process; it begins with an actor, ends with the actor, and accomplishes a business task for the actor. Use.
1 CMPT 275 Software Engineering Requirements Gathering Activity Janice Regan,
Approaching a Problem Where do we start? How do we proceed?
Chapter 18: Implementation Considerations
Lecture 3 Uses Cases Topics UML Use Cases pop quiz Readings: Chapter 3 January 24, 2008 CSCE 492 Software Engineering.
Submitted By: Memon Khurshed (Group Leader) Hamed Abdollahpur
Systems Analysis and Design in a Changing World, 3rd Edition
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 4: Restaurant.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
Chapter 12: User Interface Design
7 Systems Analysis and Design in a Changing World, Fifth Edition.
A Use Case Primer 1. The Benefits of Use Cases  Compared to traditional methods, use cases are easy to write and to read.  Use cases force the developers.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
Requirements Engineering-Based Conceptual Modelling From: Requirements Engineering E. Insfran, O. Pastor and R. Wieringa Presented by Chin-Yi Tsai.
Systems Analysis and Design in a Changing World, Fourth Edition
Chapters 10, 11 SSD (Revision) SD DCD Exam Object-Oriented Design.
UML - Development Process 1 Software Development Process Using UML.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
CSCI 383 Object-Oriented Programming & Design Lecture 7 Martin van Bommel.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
Application Analysis. Application Interaction Model The purpose of analysis is to understand the problem so.
Chapter 3: Software Design –Use case Diagram Nouf Alghanmi.
Dillon: CSE470: ANALYSIS1 Requirements l Specify functionality »model objects and resources »model behavior l Specify data interfaces »type, quantity,
Defects of UML Yang Yichuan. For the Presentation Something you know Instead of lots of new stuff. Cases Instead of Concepts. Methodology instead of the.
Engineering Quality Software Week02 J.N.Kotuba1 SYST Engineering Quality Software.
Systems Analysis and Design in a Changing World, Fourth Edition
Chapter3:Software Processes
CMPE 280 Web UI Design and Development August 29 Class Meeting
Use Case Model.
Chapter 10: Process Implementation with Executable Models
Object Oriented Analysis and Design
Copyright 2007 Oxford Consulting, Ltd
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Engineering Quality Software
Applying Use Cases (Chapters 25,26)
Applying Use Cases (Chapters 25,26)
Chapter 22 Object-Oriented Systems Analysis and Design and UML
CIS 375 Bruce R. Maxim UM-Dearborn
Chapter 6: Architectural Design
Chapter 14. Activity Modeling for Transformational Systems
Chapter 11: Deriving a Design Class Diagram
Chapter 18: Implementation Considerations
Chapter 8: Actor-System Interaction Modeling
Use cases Dr. X.
Presentation transcript:

Chapter 9: Object Interaction Modeling

Object interaction modeling helps the development team Key Takeaway Points Object interaction modeling helps the development team understand the existing business processes, and design object interaction behaviors to improve the business. Actor-system interaction modeling and object interaction modeling deal with foreground processing and background processing of a use case, respectively.

OIM in the Methodology Context Use case-iteration allocation matrix Business goals & needs Current situation Accommodating Requirements Change Customer feedback Acquiring Requirements Iteration use cases Domain Modeling Preliminary requirements Domain model Domain model Deriving Use Cases from Requirements Actor-System Interaction Modeling Abstract & high level use cases, use case diagrams Expanded use cases & UI design Allocating Use Cases & Subsystems to Iterations Behavior Modeling & Responsibility Assignment Behavior models Use case-iteration allocation matrix Deriving Design Class Diagram Producing an Architecture Design Design class diagram Software architecture Test Driven Development, Integration, & Deployment (a) Planning Phase (b) Iterative Phase – activities during each iteration control flow data flow control flow & data flow

Sequence Diagram for OIM Sequence diagram for OIM (optional)

Actor-System Interaction & Object Interaction Foreground processing of use case. Acquiring actor input and actor action. Displaying system responses. Background processing of use case by objects. Designing high-level algorithms to process actor requests. Producing system responses.

Object Interaction Modeling OIM specifies how objects interact with each other to carry out the background processing of a business process. Object interaction modeling is aided by the specification of scenarios and scenario tables. A scenario is an informal, step-by-step description of object interaction. A scenario table organizes the interaction into a five column table - it facilitates translation to a sequence diagram.

Object Interaction Modeling Steps (1) Collecting info about business processes (3) Constructing scenario tables (5) Review and inspection business processes info. scenario descriptions sequence diagrams feedback, if any (2) Describing scenarios (4) Constructing sequence diagrams expanded use cases for current iteration scenario tables design sequence domain model, design class diagram from last iteration to deriving a design class diagram (chapter 11)

Steps for Interaction Modeling Step 1. Collecting information about business processes. Step 2. Describing scenarios Identify and mark nontrivial steps in the right column of each expanded use case. A nontrivial step is one that requires background processing. It goes beyond the presentation layer (i.e., the Graphical User Interface or GUI). For each nontrivial step, describe: How objects interact to process the actor request. Begin with the step on the left column of the nontrivial step. Step 3. Convert the scenario into a scenario table, if desired. Step 4. Convert the scenarios/scenario table into a sequence diagram. Step 5. Check the OIM model for desired properties.

How to Identify a Nontrivial Step? If the step does not require background processing, then it is a trivial step. If the system response simply displays a menu, or input dialog, then it is a trivial step. If the step displays the same system response for all actors, then it is a trivial step. If the system response is different for different actors, then it is a nontrivial step.

Example * nontrivial step

Each sentence of the scenario is a declarative sentence consisting of Scenarios Each sentence of the scenario is a declarative sentence consisting of a subject, an action of the subject, an object that is acted upon, and possibly other objects required by the action. The sentences are arranged in a scenario table to facilitate scenario description and facilitate translation into a sequence diagram

reducing the number of steps. Scenario Description 3) The patron enters the call numbers of documents to be checked out and clicks the Submit button. 4.1) Checkout GUI checks out the documents with the checkout controller using the document call numbers. 4.2) Checkout controller creates a blank msg. 4.3) For each document call number, 4.3.1) The checkout controller gets the document from the database manager (DBMgr) using the document call number. 4.3.2) DBMgr returns the document d to the checkout controller. 4.3.3) If the document exists (i.e., d!=null) 4.3.3.1) the checkout controller checks if the document is available (for check out). 4.3.3.2) If the document is available for check out, 4.3.3.2.1) the checkout controller creates a Loan object using patron p and document d, 4.3.3.2.2) the checkout controller sets document d to not available, 4.3.3.2.3) the checkout controller saves the Loan object with DBMgr, 4.3.3.2.4) the checkout controller saves document d with the DBMgr, 4.3.3.4.5) the checkout controller writes “checkout successful” to msg. 4.3.3.3) else, 4.3.3.3.1) the checkout controller writes “document not available” to msg. 4.3.4) else 4.3.4.1) the checkout controller writes “document not found” to msg. 4.4) The checkout controller returns msg to Checkout GUI. 4.5) Checkout GUI displays msg to patron. Could be simplified, e.g., reducing the number of steps.

reducing the number of steps. (Message) Could be simplified, e.g., reducing the number of steps.

Guidelines for Scenario Construction Specify the normal scenario first (i.e., assume everything will go as expected). If needed, augment the normal scenario with alternative flows. Keep it simple and stupid --- leave details to coding. Leave exception handling to coding. It is sometimes desirable to construct a prototype to validate design idea.

Sequence Diagram Notions and Notations

From Scenario Table to Sequence Diagram Actor :object acted upon action + other objects/data object acted upon for each line of the scenario table: Case 1: subject is an Actor. Example: Patron card scanner: <<slide card>>

From Scenario Table to Sequence Diagram object: <<message>> actor Case 2: subject is an object and object acted upon is an actor. <<confirmation message>> Subject Object Acted Upon Other Data / Objects Subject Action system displays confirmation message Patron system:

From Scenario Table to Sequence Diagram : Subject :object acted upon action performing action + other objects/data Case 3: both subject and object acted upon are objects. Example cards canner: device control: action performing send pid

From Scenario Table to Sequence Diagram Case 4: both subject and object acted upon are the same (a special case of case 3). action + data / objects object1: return value if any Subject Object Acted Upon Other Data/ Objects Subject Action shipment compute base rate shipment:

Difference of Analysis and Design application problem-oriented models application domain describes what the world is project-oriented decisions should allow design alternatives Design software solution-oriented models the software system prescribes a software solution system-oriented decisions usually reduces implementation choices

Modeling a Manual Library System Patron presents id card to librarian. :Librarian Patron <<id card>> These are analysis sequence diagrams that model an existing system. Librarian pulls out patron’s folder using id number. :Librain Patron <<uid, pass-word>> :PatronFolders get folder using patron id patron folder

Analysis/Informal Sequence Diagram info exchange b/t actor and object :LoginGui Patron <<uid, password>> an object of LoginGui class the object is processing the request. Patron submits uid and password to LoginGui. :LoginGui Patron <<uid, pass-word>> :LoginController verify uid and password <<msg>> LoginGui calls LoginController to verify the login. The controller returns a msg indicating result of verification. LoginGui shows msg to Patron.

From Analysis to Design :LoginGui :LoginController LoginGui calls LoginController to verify the login. The controller returns a msg indicating result of verification. LoginGui shows msg to Patron. <<uid, pass-word>> verify uid and password <<msg>> <<msg>> Patron :LoginGui :LoginController <<uid, pass-word>> msg := verify (uid:String, password: Password) : String function call parameter & type return type return value Patron <<msg>>

Sequence Diagram: Flow of Control :LoginGui :LoginController 1 (1) Patron submits uid and password to LoginGui object. 2 (2) LoginGui object calls the verify function of a LoginController object. The called function returns msg of type String. <<uid, pass-word>> msg := verify (uid:String, password: Password) : String <<msg>> Patron 3 (3) The LoginGui object shows msg to patron.

An Analysis Sequence Diagram collection real world object within the library system :Patron Folder f:Patron Folder :Librarian book:Book id card, book get patron folder w/id outside library system patron folder f patron [patron folder not found] error msg, id card [patron folder found] get book card book card [patron folder found] insert book card into patron folder [patron folder found] return patron folder [patron folder found] id card, book This an analysis sequence diagram models the current, manual operation, little design decision is made.

A Design Sequence Diagram :CheckoutGUI :DBMgr l:Loan d:Document <<uid,call# list>> u:=getUser (uid):User Patron <<msg>> [u!=null] process(callNumList) Loop (for each cn in callNumList) loop d:=get Document(cn): Document [d!=null]a:=isAvailable():boolean conditional call [a]create(u,d) [a]saveLoan(l) [a]setAvailable(false) [a]save- Document(d)

Representing Various Object Instances Notation Notion and Meaning A named instance without a type, the type is not important, unknown, or to be determined at run time myCar: myCar: Car A named instance with a type, this is commonly used An unnamed instance with a type, the name is not important, or not used elsewhere in the sequence diagram :Car :Car Multiple instances or a collection of objects of a class

From Sequence Diagram to Implementation :Checkout GUI :DBMgr l:Loan d:Document public class CheckoutGUI { DBMgr dbm=new DBMgr (); public void process(String[] cnList) { for(int i=0; i<cnList.length; i++) { Document d=dbm.getDocument(cnList[i]); if (d.isAvailable()) { Loan l=new Loan(u, d); dbm.saveLoan(l); d.setAvailable(false); dbm.saveDocument(d); } <<uid,cnList>> u:= getUser(uid): User Patron <<msg>> [u!=null] process(cnList) Loop (for each cn in cnList) d:=get Document(cn): Document a:=isAvailable():boolean [a]create(u,d) [a]saveLoan(l) [a]setAvailable(false) [a]save- Document(d)

From Sequence Diagram to Implementation :Checkout GUI <<uid,cnList>> :DBMgr l:Loan [a]create(u,d) [a]saveLoan(l) d:Document [a]setAvailable(false) [a]save- Document(d) [u!=null] process(cnList) a:=isAvailable():boolean <<msg>> Loop (for each cn in cnList) Patron u:= getUser(uid): User d:=get Document(cn): Document public class CheckoutGUI { DBMgr dbm=new DBMgr (); public void process(String[] cnList) { for(int i=0; i<cnList.length; i++) { Document d=dbm.getDocument(cnList[i]); if (d.isAvailable()) { Loan l=new Loan(u, d); dbm.saveLoan(l); d.setAvailable(false); dbm.saveDocument(d); } Note the color correspondence in SD and code.

From Sequence Diagram to Implementation :Checkout GUI :DBMgr l:Loan d:Document <<uid,cnList>> u:= getUser(uid): User public class DBMgr { public Document getDocument(String cn) {...} public User getUser(String uid) {...} public void saveLoan(Loan l) { ... } public void saveDocument(Document d) {...} } Patron [u!=null] process(cnList) <<msg>> Loop (for each cn in cnList) d:=get Document(cn): Document a:=isAvailable():boolean [a]create(u,d) [a]saveLoan(l) [a]setAvailable(false) [a]save- Document(d)

Commonly Seen Mistakes :Checkout GUI :Checkout GUI :DBMgr [a]saveLoan(l) [a]save- Document(d) [u!=null] process(cnList) u:=getUser(uid): User d:=get Document(cn): Document :DBMgr u:=getUser(uid): User [u!=null] process(cnList) d:=get Document(cn): Document WRONG WAY [a]saveLoan(l) [a]save- Document(d) Correct: 4 function calls to DBMgr; the functions are executed during 4 time intervals.

Commonly Seen Mistakes :Checkout GUI :Checkout GUI :DBMgr [a]saveLoan(l) [a]save- Document(d) d:=get Document(cn): Document [u!=null] process(cnList) u:=getUser(uid): User :DBMgr u:=getUser(uid): User The call to process(...) ends here. [u!=null] process(cnList) d:=get Document(cn): Document [a]saveLoan(l) [a]save- Document(d) Correct: during execution of process(...), 3 function calls are made. The last two calls need to be initiated. But even though the semantics is still incorrect.

Commonly Seen Mistakes :Checkout GUI <<uid,cnList>> :DBMgr Patron u:=getUser(uid): User Correct: the getUser(uid) call happens after the patron submits the uid and cnList. :Checkout GUI :DBMgr Incorrect: the triggering event should happen before the getUser(uid) call. u:=getUser(uid): User <<uid,cnList>> Patron

Interaction Modeling Review Checklist Study the review checklist given in Chapter 9. Apply the review checklist to the object interaction model produced for the team project.

Applying Agile Principles Work closely with the customer and users to understand their business processes, especially how the business processes the transactions. The team members write the scenarios and construct the scenario tables together. Do not do these individually. No need to construct the scenario, scenario table, or sequence diagram if the team members understand the scenario very well. Converting the scenario table or scenario to a sequence diagram should be done off-line and be a one-person job. Keep it simple and stupid. Omit programming detail in the scenario and the sequence diagram. Constructing prototypes to remove doubt.