Introduction to Software Engineering 7. Modeling Behaviour.

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

Chapter 11 Designing the User Interface
The State Transition Diagram
UML State chart/machine diagram State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state.
ESE Einführung in Software Engineering 6. Modeling Objects and Classes Prof. O. Nierstrasz.
System Sequence Diagrams
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.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
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.
Object-Oriented Analysis and Design
12. Summary, Trends, Research. © O. Nierstrasz PS — Summary, Trends, Research Roadmap  Summary: —Trends in programming paradigms  Research:...
Lecture 5a: Sequence Interaction Diagrams CSE 111 Copyright W. Howden1.
ESE Einführung in Software Engineering N. XXX Prof. O. Nierstrasz Fall Semester 2009.
ESE Einführung in Software Engineering X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
Metamodeling Seminar X. CHAPTER Prof. O. Nierstrasz Spring Semester 2008.
© 2005 Prentice Hall4-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
ESE Einführung in Software Engineering X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
N. XXX Prof. O. Nierstrasz Thanks to Jens Palsberg and Tony Hosking for their kind permission to reuse and adapt the CS132 and CS502 lecture notes.
ESE Einführung in Software Engineering 6. Modeling Objects and Classes Prof. O. Nierstrasz.
© Copyright Eliyahu Brutman Programming Techniques Course.
State Change Modelling. Aim: To introduce the concept and techniques for describing the changes in state that may occur to an object in its lifetime.
OORPT Object-Oriented Reengineering Patterns and Techniques X. CHAPTER Prof. O. Nierstrasz.
CP — Concurrent Programming X. CHAPTER Prof. O. Nierstrasz Wintersemester 2005 / 2006.
12. eToys. © O. Nierstrasz PS — eToys 12.2 Denotational Semantics Overview:  … References:  …
SE-565 Software System Requirements More UML Diagrams.
Blaha and Rumbaugh Sections 7.2 and 8.2
Unified Modeling Language
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
Chapter 10 State Machine Diagrams
Lecture 6 Unified Modeling Language (UML)
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Introduction to Interaction Diagrams Used to illustrate the dynamic behaviour of a community of objects that collaborate by passing messages in order to.
The Animated Sequence Chapter 5.1 in Sketching User Experiences: The Workbook.
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
Unified Modeling Language* Keng Siau University of Nebraska-Lincoln *Adapted from “Software Architecture and the UML” by Grady Booch.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
An Introduction to the Unified Modeling Language
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.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
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.
(14-2) UML Instructor - Andrew O’Fallon CptS 122 (December 2, 2015) Washington State University.
Systems Analysis and Design in a Changing World, Fourth Edition
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Chapter 3: Introducing the UML
CSCI 3428: Software Engineering Tami Meredith UML Unified Modeling Language.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
CS 501: Software Engineering Fall 1999 Lecture 15 Object-Oriented Design I.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
1 An Overview of UML. 2 The Unified Modeling Language UML is a graphical language used by software engineers to model software systems during development.
Systems Analysis and Design in a Changing World, Fourth Edition
Embedded Systems Software Engineering
Appendix 3 Object-Oriented Analysis and Design
Evolution of UML.
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Business System Development
Software Engineering Chapter 5 (Part 3) System Modeling Dr.Doaa Sami.
Princess Nourah bint Abdulrahman University
Week 12: Activity & Sequence Diagrams
CIS 375 Bruce R. Maxim UM-Dearborn
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

Introduction to Software Engineering 7. Modeling Behaviour

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.2 Roadmap  Use Case Diagrams  Sequence Diagrams  Collaboration (Communication) Diagrams  Statechart Diagrams —Nested statecharts —Concurrent substates  Using UML

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.3 Source  The Unified Modeling Language Reference Manual, James Rumbaugh, Ivar Jacobson and Grady Booch, Addison Wesley, 1999.

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.4 Roadmap  Use Case Diagrams  Sequence Diagrams  Collaboration (Communication) Diagrams  Statechart Diagrams —Nested statecharts —Concurrent substates  Using UML

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.5 Use Case Diagrams A use case is a generic description of an entire transaction involving several actors. A use case diagram presents a set of use cases (ellipses) and the external actors that interact with the system. Dependencies and associations between use cases may be indicated.

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.6 Using Use Case Diagrams  “A use case is a snapshot of one aspect of your system. The sum of all use cases is the external picture of your system …” —UML Distilled  “As use cases appear, assess their impact on the domain model.” —Use cases can drive domain modeling by highlighting the important concepts.

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.7 Roadmap  Use Case Diagrams  Sequence Diagrams  Collaboration (Communication) Diagrams  Statechart Diagrams —Nested statecharts —Concurrent substates  Using UML

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.8 Scenarios A scenario is an instance of a use case showing a typical example of its execution. Scenarios can be presented in UML using either sequence diagrams or collaboration diagrams. Note that a scenario only describes an example of a use case, so conditionality cannot be expressed!

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.9 Sequence Diagrams A sequence diagram depicts a scenario by showing the interactions among a set of objects in temporal order. Objects (not classes!) are shown as vertical bars. Events or message dispatches are shown as horizontal (or slanted) arrows from the sender to the receiver.

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.10 Activations Avoid returns in sequence diagrams unless they add clarity.

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.11 Asynchrony and Constraints

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.12 Roadmap  Use Case Diagrams  Sequence Diagrams  Collaboration (Communication) Diagrams  Statechart Diagrams —Nested statecharts —Concurrent substates  Using UML

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.13 Collaboration Diagrams Collaboration diagrams (called Communication diagrams in UML 2.0) depict scenarios as flows of messages between objects:

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.14 Message Labels Messages from one object to another are labelled with text strings showing the direction of message flow and information indicating the message sequence. 1. Prior messages from other threads (e.g. “[A1.3, B6.7.1]”) – only needed with concurrent flow of control 2. Dot-separated list of sequencing elements – sequencing integer (e.g., “3.1.2” is invoked by “3.1” and follows “3.1.1”) – letter indicating concurrent threads (e.g., “1.2a” and “1.2b”) – iteration indicator (e.g., “1.1*[i=1..n]”) – conditional indicator (e.g., “2.3 [#items = 0]”) 3. Return value binding (e.g., “status :=”) 4. Message name – event or operation name 5. Argument list

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.15 Nested Message Flows

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.16 Roadmap  Use Case Diagrams  Sequence Diagrams  Collaboration (Communication) Diagrams  Statechart Diagrams —Nested statecharts —Concurrent substates  Using UML

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.17 Statechart Diagrams

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.18 Statechart Diagram Notation A Statechart Diagram describes the temporal evolution of an object of a given class in response to interactions with other objects inside or outside the system. An event is a one-way (asynchronous) communication from one object to another: —atomic (non-interruptible) —includes events from hardware and real-world objects e.g., message receipt, input event, elapsed time,... —notation: eventName(parameter: type,...) —may cause object to make a transition between states

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.19 Statechart Diagram Notation... A state is a period of time during which an object is waiting for an event to occur: —depicted as rounded box with (up to) three sections: – name — optional – state variables — name: type = value (valid only for that state) – triggered operations — internal transitions and ongoing operations —may be nested

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.20 State Box with Regions The entry event occurs whenever a transition is made into this state, and the exit operation is triggered when a transition is made out of this state. The help and character events cause internal transitions with no change of state, so the entry and exit operations are not performed.

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.21 Transitions A transition is an response to an external event received by an object in a given state —May invoke an operation, and cause the object to change state —May send an event to an external object —Transition syntax (each part is optional): event(arguments) [condition] / ^target.sendEvent operation(arguments) —External transitions label arcs between states —Internal transitions are part of the triggered operations of a state

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.22 Operations and Activities An operation is an atomic action invoked by a transition —Entry and exit operations can be associated with states An activity is an ongoing operation that takes place while object is in a given state —Modelled as “internal transitions” labelled with the pseudo-event do

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.23 Roadmap  Use Case Diagrams  Sequence Diagrams  Collaboration (Communication) Diagrams  Statechart Diagrams —Nested statecharts —Concurrent substates  Using UML

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.24 Nested Statecharts

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.25 Composite States Composite states may depicted either as high-level or low-level views. “Stubbed transitions” indicate the presence of internal states: Initial and terminal substates are shown as black spots and “bulls-eyes”

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.26 Sending Events between Objects

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.27 Roadmap  Use Case Diagrams  Sequence Diagrams  Collaboration (Communication) Diagrams  Statechart Diagrams —Nested statecharts —Concurrent substates  Using UML

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.28 Concurrent Substates

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.29 Branching and Merging Entering concurrent states: Entering a state with concurrent substates means that each of the substates is entered concurrently (one logical thread per substate). Leaving concurrent states: A labelled transition out of any of the substates terminates all of the substates. An unlabelled transition out of the overall state waits for all substates to terminate.

Is it correct?

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.31 Roadmap  Use Case Diagrams  Sequence Diagrams  Collaboration (Communication) Diagrams  Statechart Diagrams —Nested statecharts —Concurrent substates  Using UML

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.32 Perspectives Three perspectives in drawing UML diagrams: 1. Conceptual —Represent domain concepts – Ignore software issues 2. Specification —Focus on visible interfaces and behaviour – Ignore internal implementation 3. Implementation —Document implementation choices – Most common, but least useful perspective(!) —UML Distilled

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.33 Using the Notations The diagrams introduced here complement class and object diagrams. During Analysis: —Use case, sequence and collaboration diagrams document use cases and their scenarios during requirements specification During Design: —Sequence and collaboration diagrams can be used to document implementation scenarios or refine use case scenarios —State diagrams document internal behaviour of classes and must be validated against the specified use cases

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.34 What you should know!  What is the purpose of a use case diagram?  Why do scenarios depict objects but not classes?  How can timing constraints be expressed in scenarios?  How do you specify and interpret message labels in a scenario?  How do you use nested state diagrams to model object behaviour?  What is the difference between “external” and “internal” transitions?  How can you model interaction between state diagrams for several classes?

© Oscar Nierstrasz ESE — Modeling Behaviour ESE 7.35 Can you answer the following questions?  Can a sequence diagram always be translated to an collaboration diagram?  Or vice versa?  Why are arrows depicted with the message labels rather than with links?  When should you use concurrent substates?

License © Oscar Nierstrasz ESE — Introduction Attribution-ShareAlike 3.0 Unported You are free: to Share — to copy, distribute and transmit the work to Remix — to adapt the work Under the following conditions: Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. Any of the above conditions can be waived if you get permission from the copyright holder. Nothing in this license impairs or restricts the author's moral rights.