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.

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

© 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
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
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.
CS3773 Software Engineering Lecture 03 UML Use Cases.
Interaction Diagrams Activity Diagram State Machine Diagram
Systems Analysis and Design in a Changing World, Fourth Edition
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
WXGC6102: Object-Oriented Techniques Object Interaction – Sequence Diagrams References: Chapter 9 of Bennett, McRobb and Farmer: Object Oriented Systems.
Advanced Behavioral Modeling
7M822 UML Interaction Diagrams 25 November 2010.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
SE-565 Software System Requirements More UML Diagrams.
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) 
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Chapter 10 State Machine Diagrams
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Slide 16B.51 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering.
Chapter 5 Implementing UML Specification (Part II) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
The Object-Oriented Approach to Requirements
Systems Analysis and Design in a Changing World, Fifth Edition
UML basics UML distilled, a brief guide to the standard Modeling language, by Martin Fowler, 2000.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
Software Engineering Prof. Ing. Ivo Vondrak, CSc. Dept. of Computer Science Technical University of Ostrava
1 A Student Guide to Object- Oriented Development Chapter 7 State Diagrams.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
The Unified Modeling Language Part II Omar Meqdadi SE 2730 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 System Analysis and Design Using UML INSTRUCTOR: Jesmin Akhter Lecturer, IIT, JU.
Information Systems Engineering Interaction Diagrams: Sequence Diagram Collbortion Diagram.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
Chapter 5 Implementing UML Specification (Part II) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
1 Graph Coverage (6). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
OMT Modeling 1. Object Model : presented by the object model and the data dictionary. 2. Dynamic Model: presented by the state diagrams and event flow.
Systems Analysis and Design in a Changing World, Fourth Edition
States.
1 LAB What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
UML Activity Diagrams.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
 The Sequence Diagram models the collaboration of objects based on a time sequence.  It shows how the objects interact with others in a particular scenario.
1 Kyung Hee University Interaction Diagrams Spring 2001.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
Systems Analysis and Design in a Changing World, Fourth Edition
State Machine Model.
Dynamic Modeling of Banking System Case Study - I
Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram
Business System Development
UML Activity Diagrams.
States.
UML Interaction diagrams
States.
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

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 S.W. Lau and Y.K. Leung McGraw-Hill Education (Asia), 2005 Dr. Hussein Al-Zoubi

2 References Chapter 4, Object-Oriented Technology: From diagram to code with Visual Paradigm for UML Chapters 15, 18, 21, The UML User Guide

3 What You Will Learn Model message flows using sequence diagrams. Model message flows using the collaboration diagrams. Model lifetime behaviors of an object using state chart diagrams. Model performance of actions of a procedure or an activity using activity diagrams.

4 Scenario Modeling Techniques – Interaction Diagramme Scenario modeling describes how the objects in a system interact with each other in a scenario. A scenario is a sequence of events that occurs during one particular execution path within a use case of a system. Each event involves the interaction of objects passing messages between them.

5 Scenario Modeling Techniques – Interaction Diagramme (cont’d) An interaction diagram can be used to model the collaborating objects in scenarios, showing the objects involved in the scenario and the messages sent and received by them. These objects may be external or internal to the system. The messages represent the invocation of operations of the receiving objects. Two kinds of interaction diagrams: sequence diagrams and collaboration diagrams. Sequence diagrams focus on the time sequencing of messages. Collaboration diagrams focus on the structural organization of the links between collaborating objects.

6 Common UML Interaction Diagram Notation Object Symbol Naming Format Notation An object of an unspecified class. A named object of a specified class. An unnamed object of a specified class.

7 Object Stereotype Object Category DescriptionGraphical Notations Actor ObjectAn external entity that interacts with the system. Entity Object An object that models the data in the system. It often represents an object in the problem domain.

8 Object Stereotype (cont’d) Object Category DescriptionGraphical Notations Boundary Object An object that handles the communication between actor objects and the system. Control Object An object that models the flow of control and functionality that do not naturally belong to entity objects or boundary objects.

9 Messages MessageDescriptionNotation Procedure call or other nested flow of control The message sender waits for the completion of the procedure call of the message receiver. Asynchronous communication The sender dispatches a message and immediately continues with the next step of execution.

10 Messages (cont’d) MessageDescriptionNotation Return messageMessage returned from the procedure call. Message with travel delay The message will take a significant amount of time to arrive at the receiving object. (This is only used in sequence diagrams.)

11 Sequence Diagrams Interaction diagram: models the behavior of a group of objects that work together to achieve a user goal. A sequence diagram helps us identify a set of collaborating objects involved in a scenario of a use case. A sequence diagram has two dimensions: the vertical dimension and the horizontal dimension, respectively Object icons are placed horizontally at the top of the sequence diagram, and messages are passed between them.

12 Sequence Diagrams (cont’d)

13 Life Line & Activation Object with Lifeline Object with Activation

14 Creation & Destruction Object Destruction Object Destruction

15 Branching Conditional Message Transmission

16 Message that Takes Time Message Transmission that Takes Time

17 Iteration

18 Alternate Message Reception Alternate Message Reception

19 Recursion

20 Example Life line Creation Deletion

21 Example Life line Activation iteration

22 Example Life line collective iteration

23 Example Concurrent Branch

24 Collaboration Diagrams Collaboration diagrams provide another way to model a scenario. Shows the roles of objects and associations of objects in an instance of collaboration. Focus on structures of the objects rather than temporal sequence of operations. In a collaboration diagram, each object is represented by an object icon, and links are used to indicate communication paths on which messages are transmitted. Collaboration diagram = object diagram + messages between objects. Messages are presented in the same way as those in a sequence diagram; in fact, sequence diagrams and collaboration diagrams are semantically equivalent.

25 Collaboration Diagrams (cont’d)

26 Example – Telephone System

27 Example – Message with Duration

28 Example – An Automatic Teller Machine (ATM) The ATM prompts the user to insert a card. The user inserts an ATM card. The ATM prompts the user to input the PIN. The user enters the PIN. The ATM asks the bank consortium to verify the ATM card number and PIN. The bank consortium verifies the ATM card number and PIN with bank. The bank notifies the bank consortium that the PIN is correct. The bank consortium notifies the ATM the PIN is correct. The ATM prompts the user to select a service. The user selects the withdraw cash service. The ATM prompts the user to enter the amount to withdraw.

29 Example 1 – An Automatic Teller Machine (cont’d) The user enters the amount to withdraw. The ATM asks the bank consortium to process the request. The bank consortium forwards the request to bank. The bank confirms the successful execution of the request to the bank consortium which in turn notifies the ATM that the request has been approved. The ATM displays the successful transaction screen, ejects card and then dispenses cash requested. The ATM shows the main menu to the user for selecting the next service.

30 Example – An Automatic Teller Machine (cont’d)

31 Example – An Automatic Teller Machine (cont’d)

32 Example – An Automatic Teller Machine (cont’d)

Collaboration Diagram for Withdrawal of Cash Scenario of the ATM System 33

34 Example - A Soft Drink Vending Machine

35 Example - A Soft Drink Vending Machine (cont’d)

36 Dynamic Modeling Techniques Using Statechart Diagrams The behavior of an entity is not only a direct consequence of its inputs, but it also depends on its preceding state. The past history of an entity can best be modeled by a finite statechart diagram traditionally named “automata”. Statechart diagrams (or sometimes referred to as state diagrams) show the different states of an entity. Statechart diagrams can also show how an entity responds to various events by changing from one state to another.

37 What Is a State? According to Rumbaugh et al. “A state is an abstraction of the attribute values and links of an object. Sets of values are grouped together into a state according to properties that affect the gross behavior of the object.” For example, consider you have $100,000 in a bank account. The behavior of the withdraw function would be: balance := balance – withdrawAmount; provided that the balance after the withdrawal is not less than $0; However, if the account balance becomes negative after a withdrawal, the behavior of the withdraw function would be quite different.

38 What Is a State?(cont’d) There are several characteristics of states: A state occupies an interval of time. A state is often associated with an abstraction of attribute values of an entity satisfying some condition(s). An entity changes its state not only as a direct consequence of the current input, but it is also dependent on some past history of its inputs.

39 UML Notation

40 UML Notation (cont’d) Action or activityDescription entry/ action 1; …; action nUpon entry to the state, the specified actions are performed. exit/ action 1; …; action nUpon exit from the state, the specified actions are performed. do/ activityThe specified activity is performed continuously while in this state. event-name(parameters) [guard-condition] / action 1 ; …; action n An internal transition is fired when the specified event occurs and the specified guard condition is true. The specified actions are performed when the transition is fired.

41 UML Notation (cont’d) Initial state Final state State History state Junction state Concurrent composite state Transition

42 Transition A transition from one state to another takes place instantaneously in response to some external events or internal stimuli.

43 Transition (cont’d) A transition is fired when the following conditions are satisfied: The entity is in the state of the source state. An event specified in the label occurs. The guard condition specified in the label is evaluated to be true. When a transition is fired, the actions associated with it are executed.

44 Composite State

45 Composite State (cont’d)

Dynamic Modeling Techniques Using Activity Diagrams The activity diagram is specifically designed for modeling performance of actions of an activity or procedure 46

Action and Sub-activity States The action state is used to model a single step in the execution of a procedure or workflow process, and cannot be further decomposed. The sub-activity state can be further decomposed as it corresponds to another activity diagram. 47

Action and Sub-activity States 48

Transition 49

Branching 50

Forks and Joins 51

Swimlanes 52

Swimlanes 53