Interaction Diagrams Activity Diagram State Machine Diagram

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Advertisements

Withdrawal Transaction Use Case Primary Actor: Customer Pre-conditions: The customer must have a valid ATM card and PIN. Post-conditions: The customer.
Use Case Diagrams Damian Gordon.
Use Case & Use Case Diagram
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Extending the Requirements Model - techniques for detailing use cases
CPSC 333: Foundations of Software EngineeringJ. Denzinger Small Test: Bank account manager System has to run on an automated teller machine. User must.
Lecture 8 Electronic Commerce Modelling Techniques
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Sequence Diagrams. Introduction A Sequence diagram depicts the sequence of actions that occur in a system. The invocation of methods in each object, and.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Chapter 12 ATM Case Study, Part 1: Object-Oriented Design with the UML
SE 555 Software Requirements & Specification 1 Activity Diagrams.
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
© 2005 Prentice Hall4-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
System Analysis and Design
COMP1007 Intro to Requirements Analysis © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Introduction to Requirements Analysis Lecture.
SE-565 Software System Requirements More UML Diagrams.
1COM6030 Systems Analysis and Design © University of Sheffield 2005 COM 6030 Software Analysis and Design Lecture 6 - Use cases and activity diagrams Dr.
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.
Use Case Modeling. Use case diagram For each use case we develop  Object class diagram (with attributes only)  System sequence diagram (analysis) 
Use Cases 2 ENGR ♯10 Peter Andreae
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Chapter 7 Structuring System Process Requirements
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
1 Object-Oriented Analysis Use Case Driven. 2 The outline method for OOA 1.Identify object classes within the problem domain 2.Define the behaviour of.
Faculty of Computer & Information Software Engineering Third year
Dynamic Modeling Chapter 11 Part of Analysis Modeling Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
Behavioral Modeling: Sequence and Communication Diagrams Copyright © 2009 John Wiley & Sons, Inc. Copyright © 2005 Pearson Education Copyright © 2009 Kannan.
Behavioral Modeling Chapter 8.
9-1 © Prentice Hall, 2004 Chapter 9: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
9-1 © Prentice Hall, 2007 Chapter 9: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
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.
UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
CS212: Object Oriented Analysis and Design Lecture 32: Use case and Class diagrams.
Scenario A scenario is a sequence of steps describing an interaction between a user and a system. Use case is a set of scenarios tied together by a common.
Dynamic Models Sequence Diagrams Collaboration Diagrams Activity Diagrams.
1 LAB What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4.
7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
Chapter 3: Introducing the UML
UML - Development Process 1 Software Development Process Using UML.
Analysis Classes. What Is an Analysis Class?  A class that represents initial data and behavior requirements, and whose software and hardware-oriented.
Chapter 6: Structuring Requirements: Use Case Description and Diagrams Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 17 Object-Oriented Design and Modeling Using the UML.
Appendix Object-Oriented Analysis and Design: Use Cases and Sequence Diagrams Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
Chapter 7 Behavioral Modeling Brandon A. Jones Stand and Deliver ITEC March 6, 2011.
UC Diagram & Scenario RKPL C & D. Using Use Case Diagram Use case diagrams are used to visualize, specify, construct, and document the (intended) behavior.
1 Object-Oriented Static Modeling of the Banking System - III Lecture # 33.
1 Case Study and Use Cases for Case Study Lecture # 28.
Analysis Classes Unit 5.
Using Use Case Diagrams
ATM OO Design and Implementation Case Study
Storyboarding and Game Design SBG, MBG620 Full Sail University
Sequence Diagrams.
Dynamic Modeling of Banking System Case Study - I
Unified Modeling Language
Object-Oriented Static Modeling of the Banking System - I
Activity and State Transition Diagram
Sequence Diagrams.
UML Activity Diagrams.
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Week 12: Activity & Sequence Diagrams
Using Use Case Diagrams
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

Interaction Diagrams Activity Diagram State Machine Diagram Modeling Behavior Interaction Diagrams Activity Diagram State Machine Diagram OOAD

Learning Objectives Understand how to represent system logic with interaction diagrams. Understand how to represent system logic with activity diagram. Understand how to represent system logic with state machine diagram. Chapter 8 Appendix © 2008 by Prentice Hall 2 2

UML Dynamic Modeling In all systems, events happen dynamically, e.g.: Objects are created and destroyed Objects send messages to one another External events trigger operations on certain objects Objects have states that would be difficult to capture in a static model OOAD

UML Dynamic Modeling (cont.) Behavior diagrams (dynamic): Interaction diagrams Sequence diagrams Collaboration diagrams Statechart diagrams Activity diagrams OOAD

Sequence Diagrams: An example OOAD

Collaboration diagram: An Example OOAD

When to use Interaction Diagrams? Interaction diagrams are used when you want to model the behavior of several objects in a use case.  They demonstrate how the objects collaborate for the behavior.  Interaction diagrams do not give a in depth representation of the behavior.  If you want to see what a specific object is doing for several use cases use a state diagram.  To see a particular behavior over many use cases or threads use an activity diagrams. OOAD

Messages are passed between objects, and may contain parameters (e. g Messages are passed between objects, and may contain parameters (e.g., message name (parameter list))

Sequence Diagrams Describing the behavior of a system by viewing the interaction between the system and its environment Shows the objects participating in the interaction by their life lines and the messages they exchange Shows an interaction arranged in a time sequence OOAD

Elements of a sequence diagram Objects: represented by boxes at top of diagram. Lifeline: the time during which an object exists. Messages: means by which objects communicate with each other. Activation: the time period during which an object performs an operation. OOAD

Objects/Classes activation lifeline Client ATMMachine SavingAccount Insert ATM card Request PIN Enter PIN code Verify PIN code PIN valid activation Request amount Enter amount Process transaction Transaction successful Dispense cash Print receipt lifeline

Collaboration Diagrams Also known as Communication diagrams Represents a collaboration, which is a set of objects related in a particular context, and interaction, which is a set of messages exchanged among the objects within the collaboration to achieve a desired outcome sequences of messages are shown by numbering OOAD

:ATMMachine :Client :SavingAccount 1: insert ATM card 3: enter PIN code 7: enter amount :ATMMachine :Client 2: request PIN 6: request amount 10: dispense cash 11: print receipt 4: verify PIN code 8: process transaction 5: valid PIN code 9: transaction successful :SavingAccount

Sequence Vs Collaboration Sequence Diagram: Dynamic behavior of a set of objects arranged in time sequence, new objects added to the right Good for real-time specifications and complex scenarios easier to read Collaboration Diagram : Shows the relationship among objects. Does not show time Objects are arranged in a graph or network format Both are used to examine the behavior of objects within a single use case OOAD

How to draw sequence diagram?

Drawing Sequence Diagrams Determine the context of the sequence diagram Identify the object that are participate in the sequence Set of the lifeline for each object Lay out of messages from the top to the bottom of the diagram based on the order in which they sent Add the execution occurrence to each object’s lifeline Validate the sequence diagram

Identifying Classes/Objects Noun phrase approach – read through the requirements or use cases looking for noun phrases Some classes are implicit or taken from general knowledge Carefully choose and define class names OOAD

Use Case: Withdraw saving A customer wants to draw money from his bank account. He enters his card into an ATM (automated teller machine). The ATM machine prompts “ Enter PIN”. The customer enters his PIN. The ATM (internally) retrieves the bank account number from the card. The ATM encrypts the PIN and the account number and sends it over to the bank. The bank verifies the encrypted account and PIN number. If the PIN number is correct, the ATM displays, “Enter Amount”. Draws money from the bank account and pays out the amount. OOAD

Use Case: Withdraw saving Actors: Bank Client Flow of Events: Bank client insert ATM card into ATM machine ATM machine request PIN code Bank client enter PIN code Verify PIN code entered with saving account ATM machine request amount if the PIN is valid Bank client enter the required amount Process the transaction in the client account ATM machine dispense cash ATM machine print receipt when the transaction completed Alternative Flow of Events Invalid PIN code entered. Indicate error message. Return step 3. OOAD

Identifying Classes – noun phrase approach (example) ATM System Bank Client ATM Card ATM Machine Savings Account Cash Message OOAD

Client ATMMachine SavingAccount Insert ATM card Request PIN Enter PIN code Verify PIN code PIN valid Request amount Enter amount Process transaction Transaction successful Dispense cash Print receipt

Another example … OOAD

Display message to client ATM System ATM approval Deposit amount Client Withdraw amount Use case: ATM approval Insert ATM card Request PIN Enter PIN Verify PIN Display message to client

Client ATM Machine ClientDatabase Use case: ATM approval Insert ATM card Request PIN Enter PIN Verify PIN Display message to client

Use case: Withdraw amount Request withdrawal amount ATM System ATM approval Deposit amount Client Withdraw amount Use case: Withdraw amount Request withdrawal amount Enter withdrawal amount Check account Verify sufficient funds Eject cash

Object naming Syntax: [objectName]:[className] Include object (instance) names when objects are referred to in messages or when several objects of the same type exist in the diagram Name classes consistently with your class diagram Object A: Class A Object B: Class B :User messageA() messageB(“string”) messageC()

Stereotypes of Analysis Classes Classes or objects can be classified into one of the following three stereotypes: Entity – to hold data Boundary – used by actors to interact with the system For example: Customer place order, interact using a order form. Control – coordinating behavior in the system For example: control the activities in the transaction (i.e., rules, calculations)

Stereotypes of Analysis Classes Is an object relation that is extended to include responsibilities

Stereotypes of Analysis Classes Is an object relation that is extended to include responsibilities

Stereotypes of Analysis Classes A boundary class provides the interface between an actor and use case. The actor can be a human or an external system. Encapsulates connections between actors and use cases

Stereotypes of Analysis Classes A boundary class provides the interface between an actor and use case. The actor can be a human or an external system. Encapsulates connections between actors and use cases

Stereotypes of Analysis Classes A control class coordinates the tasks and captures the main logic in a use case. Mostly performs behaviors associated with inner workings of use cases

Typically, actors interact with boundary classes, which in turn interact with control classes, which in turn interact with entity classes.

Operations (behaviors) are depicted in the lower third of a class box. Operations fulfill the class’s responsibilities.

Activity Diagram State Diagram Modeling Behavior Activity Diagram State Diagram OOAD

Activity Diagram: An example OOAD

When to use Activity Diagram? The main reason to use activity diagrams is to model the workflow behind the system being designed.  Activity Diagrams are also useful for: analyzing a use case by describing what actions need to take place and when they should occur;  describing a complicated sequential algorithm;  and modeling applications with parallel processes. OOAD

Activity Diagram Focus on flow of activity of internal process in object similar to flowchart describe changes in activity in a procedure information from use case scenario or event flow can be used to describe activity diagram. Used to provide detail for complex algorithms OOAD

Activity Diagram (cont.) Purpose: Modeling human task Describe system’s function Describe logic operation Elements in activity diagram: Activity Transition Decision OOAD

Example of Activity Diagram for Register Course start Fill form Select course [No] Submit to PA approve? [Yes] Register course end

Example of Activity Diagram for ATM Authorization Enter card Read card Request PIN Enter PIN [No] Verify PIN valid? [Yes] Select other service

Swimlane partition an activity diagram so that parts in the swimlane relevant to that activities in the partition helpful in investigating responsibilities for interactions and associations between objects and actors OOAD

Top synchronization bar is a fork. Activity diagram with synchronization bars – split into multiple paths and multiple paths combined into a single transition Top synchronization bar is a fork. Bottom synchronization bar is a join. OOAD

OOAD

When to use State Diagram? Use state diagrams to demonstrate the behavior of an object through many use cases of the system.  Only use state diagrams for classes where it is necessary to understand the behavior of the object through the entire system OOAD

What is a State Diagram? A diagram that captures the behavior of an object by specifying the sequence of states it goes through during its lifetime in response to events, together with the responses to those events describe changes in state in a procedure Also called statechart diagram or state machine diagram State – a condition or situation during the life of an object at which time it satisfies some condition, performs some activity, or waits for some event. OOAD

What is a State Diagram? (cont.) A state diagram to describe the behavior (i.e., state changes) of a single class according to events and messages which class sends and receives A state diagram can also clarify a use case – to specify the actions the use case can take in accordance with varying conditions of the system E.g., a use case ‘enroll course’, the state can be full, opened, and closed. OOAD

State Diagram Example Paying Paid Unpaid Invoice created Invoice destroyed Paying Paid Unpaid

Transition Notation Event(parameters) [condition] /action State 1 do/activity 1 State 2 . . . Start state transition End state Example: Event(parameters) [condition] mouse_button_clicked(right_button)[inside the window] Example: /action /calculate amount

State Notation Name compartment Action labels OOAD

Recap After studying this chapter we learned to: Understand how to structure requirements with interaction diagram, activity diagram and state machine diagram. Explain the element of sequence diagrams, activity diagram and state machine diagram. Construct sequence diagrams, activity diagram and state machine diagram