1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.

Slides:



Advertisements
Similar presentations
Object-Oriented Software Engineering Visual OO Analysis and Design
Advertisements

GRADUATION PROJECT-1 SEMINAR- 2: Phases and Project 1 Guide Academic Year: / Semester I.
ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
Introduction to Software Engineering 7. Modeling Behaviour.
Essentials of interaction diagrams Lecture 23 & 24.
Chapter 8: Modelling Interactions and Behaviour
Essentials of state and activity diagram Lecture 24.
Modeling Dynamic Behavior: State and Activity Diagrams.
NJIT Drawing System Sequence Diagrams Chapter 10 Applying UML and Patterns Craig Larman Presented by Anuradha Dharani.
7M822 UML Interaction Diagrams 25 November 2010.
Modeling Dynamic Behavior: Sequence and Collaboration Diagrams.
SE-565 Software System Requirements More UML Diagrams.
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
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.
Unified Modeling Language
LECTURE 5 SEQUENCE DIAGRAM 1. INTRODUCTION – SYSTEM SEQUENCE DIAGRAM A system sequence diagram is a fast and easily created artifact that illustrates.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Class, Sequence and UML Model.  Has actors and use cases.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Modelling Interactions and Behaviour. © Lethbridge/Laganière 2005 Chapter 8: Modelling Interactions and Behaviour2 Interaction Diagrams Interaction diagrams.
1 CSC 450 Slides adapted from slides created by Robert B. France UML Behavioral Models.
Interaction diagrams Sequence and collaboration diagrams.
State diagrams Interaction diagrams –Sequence diagrams –Collaboration diagrams Object orientation Part 4: Dynamic Modeling.
Interaction Modeling. Introduction (1) Third leg of the modeling tripod. It describes interaction within a system. The class model describes the objects.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML Sequence Diagrams.
Modelling interactions and behaviour Adapted after : Timothy Lethbridge and Robert Laganiere, Object-Oriented Software Engineering – Practical Software.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Drawing System Sequence Diagrams
Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.
Information System Design IT60105
Sequence Diagrams Sequence; Interaction Diagrams Behavioral Diagrams
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
CSE 240 Lecture 11. Quote of the day "The ideal engineer is a composite... He is not a scientist, he is not a mathematician, he is not a sociologist or.
UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
CS3773 Software Engineering Lecture 06 UML State Machines.
Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour Based on Presentations.
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.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
1 Kyung Hee University Interaction Diagrams Spring 2001.
Project 2: Phase 1 Submission 7 Late submissions 10% 10 No submissions 14% Better than project 1 phase 3 submissions 10-point bonus: If you catch the deadline.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Systems Analysis and Design in a Changing World, Fourth Edition
State Machine Diagram.
Object-Oriented Analysis and Design
State Diagrams Pepper.
CS251 – Software Engineering Lectures 11 State Diagrams
UML dynamic Modeling (Behavior Diagram)
Sequence Diagrams.
UML Sequence Diagrams.
Princess Nourah bint Abdulrahman University
Sequence Diagrams Lecture 6.
CIS 375 Bruce R. Maxim UM-Dearborn
Unified Modelling Language
UML Interaction diagrams
Interaction Modeling Extracted from textbook:
Software design and architecture
CIS 375 Bruce R. Maxim UM-Dearborn
Presentation transcript:

1 Modeling interactions and behavior Lecturer Dr. Mai Fadel

2 Introduction An interaction model shows a set of actors and objects interacting by exchanging messages. A behavior model shows how an object or system changes state in reaction to series of events.

3 8.1 Interaction diagrams Interaction diagrams are used to model the dynamic aspects of a software system – they help to visualize how the system runs. They show how a set of actors and objects communicate with each other to perform the steps of a use case or some other piece of functionality. Interaction diagrams can show several types of communication. e.g. messages exchanged over a network, simple procedure calls, and commands issued by an actor through the user interface. Collectively these are referred to as messages. The following elements can be found in an interaction diagram: –Instances of classes or actors: use same symbols for objects and actors –Messages: shown as arrows. One of the objectives of interaction diagrams is to better understand the sequence of messages.

4 Sequence diagrams A sequence diagram shows the sequence of messages exchanged by the set of objects (and optionally an actor) performing a certain task. Object are arranged from left to right – an actor that initiates the interaction is often shown on the left. Vertical dimension represents time. Lifeline: is attached to each object or actor. It becomes an activation box during the period of time that the object is performing computations. The message is represented as an arrow between activation boxes of the sender and receiver. (label, argument list and response). Syntax: Response:=message(arg,…)

5 Example: the process of the registration of a student in a course

6 Example: the process of the registration of a student in a course – detailed level

7 Notes about the example The use of combined fragment marked opt. –Combined fragment is a subsequent of interaction that is special in some way, and is shown in a box. –The ‘opt’ label means that it may or may not occur. –A boolean condition, written in square brackets, describes the circumstances when it will occur. –In this example, the condition is placed over the CourseSection lifline, and indicates that the subsequence in the combined fragment will only occur if the hasPrerequisite variable is true.

8 Representing loops in a combined fragment

9 Destroy symbol in sequence diagrams

10 Communication Diagrams A communication diagram shows several objects working together. It is very much like an object diagram except that it shows communication links instead of links of associations. It has much in common with sequence diagrams Message: arrow with label, and a prefix number showing the order of the message Communication links can exist between two objects whenever it is possible for one object to send a message to the other one.

11

12 How to choose between using a sequence or a communication diagram Sequence diagrams are often the better choice for the following situations: –You want the reader to be able to easily see the order in which the messages occur –You want to build an interaction model from use case. (they already have a sequence of steps, SD shows the objects involved) –You need to show the details of messages, such as parameters, and return values. (CD too much clutter) –You need to show loops, optional sequences and other things that can only be properly expressed using combined fragments. Prefer CD when deriving interaction diagram from class diagrams. (CD are very similar to object diagrams) CD can be used to validate class diagrams: suggest adding an association in order to make an interaction possible.

13 State diagrams Also known as state machine diagram It is another way of expressing dynamic information about a system At any given point in time, the system or object is said to be in a certain state. It remains in this state until an event occurs that causes it to change state. In each state, the system behaves in a different way. A transition represents a change of state in response to an event, and is considered to occur instantaneously – that is it takes no time. Symbols in state diagrams: rounded rectangles, arrows, labels on arrows, black circle, black circle with a ring around. A start state: when a system starts running, it immediately takes a transition from the start state to a regular state. Only one start state and one unlabelled transition from it. End state: when the system finishes its work when such a state is reached. More than one end state.

14

15 Elapsed-time transition The event that trigger a transition can be a certain amount of elapsed time. after (30s) No end state

16 Transitions triggered by a condition becoming true Cancelled Closed State diagram of a CourseSection class

17 Activities and actions in state diagrams You can present two kinds of computations using state diagrams: activities and actions. Activity is something that occurs over a period of time while the system is in a state. –The system may take a transition out of the state in response to completion of the activity. –If some other transition is triggered first, then the system has to terminate the activity as it leaves the state –It is shown textually by the word do/, followed by the description of what is to be done.

18 An action is something that takes place effectively instantaneously in any of the following situations: –When the system takes a particular transition. –Upon entry to a particular state, no matter which transition causes entry. –Upon exit from a particular state no matter which transition is being taken It should take place with no consumption of time => simple, such as sending a message, starting a hardware device, or setting a variable. Syntax: event/action, enter/action, exit/action. Activities and actions in state diagrams ProposeSelection MusicPlaying do/ play chosen selection Press button

19 State diagram for a garage door opener Partial state diagram for a tape recorder