UNIT-4 Behavioral Diagrams

Similar documents
Interactions A link message

Ingegneria del Software Corso di Laurea in Informatica per il Management

State Machine Diagrams

STATE MACHINES. Figure 1: State Machines

Meltem Özturan

UNIT-IV BASIC BEHAVIORAL MODELING-I

UML- a Brief Look UML and the Process

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Unified Modeling Language 2

CS 370 REVIEW: UML Diagrams D R. M I C H A E L J. R E A L E F A L L

UML Diagrams MagicDraw UML Diagrams

What is a Class Diagram? A diagram that shows a set of classes, interfaces, and collaborations and their relationships

What is a Class Diagram? Class Diagram. Why do we need Class Diagram? Class - Notation. Class - Semantic 04/11/51

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

LABORATORY 1 REVISION

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

OMG Modeling Glossary B

INTRODUCTION TO UNIFIED MODELING MODEL (UML) & DFD. Slides by: Shree Jaswal

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

UML REFERENCE SHEETS. 2013, 2014 Michael Marking; all rights reserved, including moral rights. Web site:

Lab Manual. Object Oriented Analysis And Design. TE(Computer) VI semester

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Enterprise Architect. User Guide Series. UML Models. Author: Sparx Systems. Date: 30/06/2017. Version: 1.0 CREATED WITH

Interaction Modelling: Sequence Diagrams

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

UNIT 5 - UML STATE DIAGRAMS AND MODELING

Activity Diagram Written Date : September 02, 2016

Vidyalankar. T.Y. Diploma : Sem. VI [IF/CM] Object Oriented Modeling and Design Prelim Question Paper Solution

APPENDIX M INTRODUCTION TO THE UML

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 8: Modelling Interactions and Behaviour

UNIT V *********************************************************************************************

3. Business Process Diagrams

Advanced Software Engineering

3. Business Process Diagram Concepts

Software Service Engineering

Appendix D: Mapping BPMN to BPD Profile

visualstate Reference Guide

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

Enterprise Architect - UML Dictionary

Object-Oriented and Classical Software Engineering

Finite State Machines and Statecharts

Software Engineering. Page 1. Objectives. Object-Behavioural Modelling. Analysis = Process + Models. Case Study: Event Identification

Business Process Modeling. Version /10/2017

Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic

Stateflow Best Practices By Michael Burke

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

user.book Page 45 Friday, April 8, :05 AM Part 2 BASIC STRUCTURAL MODELING

Object Oriented Design. Program Design. Analysis Phase. Part 2. Analysis Design Implementation. Functional Specification

Object-Oriented Modeling. State Machine Diagram. Slides accompanying Version 1.0

Use Case Model. Static Structure. Diagram. Collaboration. Collaboration. Diagram. Collaboration. Diagram. Diagram. Activity. Diagram.

UNIT-II Introduction to UML

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

Models are used for several purposes. We believe that some of the most important are:

Basic Structural Modeling. Copyright Joey Paquet,

Developing Shlaer-Mellor Models Using UML

HCM Modeling Elements. Creating a better understanding of the process model standards used within the MHR-BPS Process Modeling initiative.

Unified Modeling Language I.

BASICS OF UML (PART-2)

Software Design Methodologies and Testing. (Subject Code: ) (Class: BE Computer Engineering) 2012 Pattern

Business Process Model and Notation (BPMN)

What s Next. INF 117 Project in Software Engineering. Lecture Notes -Spring Quarter, Michele Rousseau Set 6 System Architecture, UML

In This Lecture You Will Learn: Specifying Control. Statechart. Event, State and Transition

Modeling with Activity Diagram

CHAPTER 5 CO:-Sketch component diagram using basic notations 5.1 Component Diagram (4M) Sample Component Diagram 5.2 Deployment Diagram (8M)

Activities Radovan Cervenka

UML 2.0 State Machines

SEEM4570 System Design and Implementation. Lecture 10 UML

BPMN Getting Started Guide

CA314 Object Oriented Analysis & Design - 7. File name: CA314_Section_07_Ver01 Author: L Tuohey No. of pages: 16

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Business Process Modeling. Version 25/10/2012

Data and Process Modelling

Übungsfragen für den Test zum OMG Certified UML Professional (Intermediate) Download

Deriving Model-to-Code Transformation Rules at the Meta- Model Level

SEEM4570 System Design and Implementation Lecture 11 UML

Statecharts 1.- INTRODUCTION 1.- INTRODUCTION

Darshan Institute of Engineering & Technology for Diploma Studies

MSc programme (induction week) Department of Informatics INTRODUCTION TO UML

Chapter 2: The Object-Oriented Design Process

UML 2.0 UML 2.0. Scott Uk-Jin Lee. Division of Computer Science, College of Computing Hanyang University ERICA Campus

EXTENDED DISTRIBUTED UML-BASED PROTOCOL SYNTHESIS METHOD

What is use case modeling? 10 - UML Overview. Use-Case diagrams CMPSCI520/620. Rick Adrion 2003 (except where noted) 1

IS 0020 Program Design and Software Tools

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Structured and Object Oriented Analysis and Design

Introduction to Software Engineering. 6. Modeling Behaviour

Activity Nets: A UML profile for modeling workflow and business processes

Introduction To UML PART II State Diagrams

Today s Agenda UML. CompSci 280 S Introduction to Software Development. 1.Introduction UML Diagrams. Topics: Reading:

Introduction to Software Engineering. ECSE-321 Unit 9 Architectural Design Approaches

Practical UML - A Hands-On Introduction for Developers

Bonita Workflow. Development Guide BONITA WORKFLOW

Chapter No. 2 Class modeling CO:-Sketch Class,object models using fundamental relationships Contents 2.1 Object and Class Concepts (12M) Objects,

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

UML Start-Up Training UB1

Chapter 4. Capturing the Requirements. 4th Edition. Shari L. Pfleeger Joanne M. Atlee

UML Notation Guide 3. Contents. Part 1 - Background Introduction 3-5

Transcription:

UNIT-4 Behavioral Diagrams P. P. Mahale

Behavioral Diagrams Use Case Diagram high-level behaviors of the system, user goals, external entities: actors Sequence Diagram focus on time ordering of messages Collaboration Diagram focus on structural organization of objects and messages State Chart Diagram event driven state changes of system Activity Diagram flow of control between activities

Use case Diagram A use case diagram is a diagram that shows a set of use cases and actors and their relationships. Common Properties A use case diagram is just a special kind of diagram and shares the same common properties as do all other diagrams a name and graphical contents that are a projection into a model.

Use case Diagram Contents Use case diagrams commonly contain Use cases Actors Dependency, generalization, and association relationships Common Uses 1. To model the context of a system 2. To model the requirements of a system

Terms and Concepts Use case Diagram A use case diagram is a diagram that shows a set of use cases and actors and their relationships. Names Every use case must have a name that distinguishes it from other use cases. A name is a textual string. Figure Simple and Path Names

Use case Diagram Use Cases and Actors An actor represents a coherent set of roles that users of use cases play when interacting with these use cases. Typically, an actor represents a role that a human, a hardware device, or even another system plays with a system. Figure : Actors

Use case Diagram Use Cases and Flow of Events A use case describes what a system does but it does not specify how it does it. You can specify the behavior of a use case by describing a flow of events in text clearly enough for an outsider to understand it easily. For example, in the context of an ATM system, you might describe the use case Validate User in the following way: Main flow of events: Exceptional flow of events:

Use case Diagram Use Cases and Scenarios A scenario is a specific sequence of actions that illustrates behavior. Use Cases and Collaborations As Figure shows, you can explicitly specify the realization of a use case by a collaboration. Figure : Use Cases and Collaborations

Organizing Use Cases Use case Diagram You can organize use cases by grouping them in packages in the same manner in which you can organize classes. Figure : Generalization, Include, and Extend

Use case Diagram

Interaction Diagrams Sequence diagrams and collaboration diagrams both of which are called interaction diagrams Sequence Diagrams A sequence diagram emphasizes the time ordering of messages. Figure : Sequence Diagram

Interaction Diagrams Sequence & collaboration are call interaction diagram used for modeling dynamic aspect of system It represent interaction, consist of set of objects & their relationships including message 1. Sequence diagram is an interaction diagram that shows time ordering of messages 2. Collaboration diag. is an interaction diagram that shows structural organization of object that send & receive message Model particular flow of control of use case

Graphically sequence diagram is table that shows objects arranged in x- axis & messages ordered in increasing time along y-axis Graphically collaboration diagram is collection of vertices & arcs Common properties of interaction diagram : - Share common properties such as name & graphical content - Content of interaction diagram : 1. Object 2. Link 3. Messages - Also contains notes & constraints

1. Sequence diagram :- - Shows time ordering - Formed by placing objects that participate in interaction at top of diagram - Place object that initiate interaction at the left & increasingly more subordinate objects to right - Place message that these object send & receive along y-axis in order of increasing time from top to bottom - 2 feature that distinguish from collaboration 1. There is object life line: - It is vertical dashed line that represent existence of an object over a period of time - Object are aliened at top with their life line dawn from top to bottom

2. There is focus of control - It is tall, thin, rectangular that shows period of time in which an object perform an action - Top of rectangle is aliened with start of action, bottom with completion

2. Collaboration Diagram - It shows structural organization of object that participate in interaction - It formed by placing object that participate in interaction as vertices in graph - show link that connect these object as arc - Show message that object send & receive

Collaboration Diagrams Interaction Diagrams A collaboration diagram emphasizes the organization of the objects that participate in an interaction. Figure : Collaboration Diagram

Timing Diagrams Interaction Diagrams Timing diagrams are a special representation of interactions that focus on the specific timings of messages sent between objects. You can use timing diagrams to show detailed time constraints on messages or to show when changes occur within lifelines with respect to time. Timing diagrams are most often used with real-time or embedded systems.

Interaction Diagrams Figure : Simple timing diagram

Interaction Diagrams Figure : Timing diagram with tick marks

Interaction Diagrams Figure : Timing diagram with time constraints

Interaction Diagrams Figure : Timing diagram with multiple lifelines and messages

Interaction Diagrams Figure : Timing diagram using a simpler timeline notation

Communication diagrams In UML 2.0 communication diag. is a simplified version of UML 1.x collaboration diag. 4 type of interaction diag.: - Sequence diagram - Communication diagram - Interaction overview diagram - Timing diagram Model interaction between object Communication diag. represent combination of info. Taken from class, sequence, use case diag. describing both static & dynamic behavior of system It shows message flow between objects in OO application & also imply basic association between classes

State chart Diagram

State chart Diagram UML has two types of state machines: Behavioral state machines Show the behavior of model elements such as objects. A behavioral state machine represents a specific implementation of an element. Protocol state machines Show the behavior of a protocol. Protocol state machines show how participants may trigger changes in a protocol's state and the corresponding changes in the system (i.e. The new state of the protocol).

Behavioral State Machines You can model the behavior of the classifier using states, pseudostates, activities and transitions.

Protocol State Machines

States States model a specific moment in the behavior of a classifier. This moment in time is defined by some condition being true in the classifier. A state is shown as a rectangle with rounded corners. The name of the state is written inside the rectangle. Figure A simple state A state name may be placed outside of the rectangle in a tab notation when showing composite or submachine states Figure : A state with its name in a tab

Within the rectangle a state can be divided into compartments as needed. UML defines the following compartments: Figure : A state with compartments

UML defines three types of states: 1. Simple states Simplest of all states, they have no substates. All the example states used so far in this section are simple states. 2. Composite states Have one or more regions for substates. A composite state with two or more regions is called orthogonal. 3. Submachine states Semantically equivalent to composite states, submachine states have substates that are contained within a substate machine. Unlike composite states, submachine states are intended to group states, so you can reuse them.

Composite States Figure : A composite state with one region Figure: Composite state with composite icon

Regions A region is shown using a dashed line dividing the decomposition compartment. You may name each region by writing its name within the region's area. Figure shows a composite state with two regions.

Submachine state A submachine state is shown in the same rounded rectangle as any other state, except you show the name of the state, followed by a colon (:) followed by the name of the referenced submachine. Figure shows a submachine state.

Transitions A transition shows the relationship, or path, between two states or pseudostates. It represents the actual change in the configuration of a state machine as it heads from one state to the next. Transitions are shown as a line between two states, with an arrowhead pointing to the destination state.

Transitions When the action or activity of a state completes, flow of control passes immediately to the next action or activity state. You specify this flow by using transitions to show the path from one action or activity state to the next action or activity state. In the UML, you represent a transition as a simple directed line, as Figure shows. Trigger less transitions may have guard conditions, meaning that such a transition will fire only if that condition is met;

trigger [guard] / effect where: Trigger Indicates what condition may cause this transition to occur. The trigger is typically the name of an event, though it may be more complex. Guard Is a constraint that is evaluated when an event is fired by the state machine to determine if the transition should be enabled. Guards should not have any side effects and must evaluate to a Boolean. Guards will always be evaluated before a transition is fired. Effect Specifies an activity that is executed when a transition happens. This activity can be written using operations, attributes, and links of the owning classifier as well as any parameters of the triggering event. An effect activity may explicitly generate events such as sending signals or invoking operations.

Transition types Compound transition: A representation of the change from one complete state machine configuration to another. High-level transition: A transition from a composite state. Internal transition: A transition between states within the same composite state. Completion transition: A transition from a state that has no explicit trigger. When a state finishes its do activities, a completion event is generated.

Signal Symbols Transitions may be shown in more detail using explicit icons to show signal sending, signal receipt, and effect activities. Figure A transition-oriented view showing a signal being received

Activities An activity represents some functionality that is executed by a system. Each activity has a label showing when the activity executes, and an optional activity expression. An activity is written as: label / activity expression You can write an activity expression using pseudo code: list.append(keystroke) ; print("*") or natural language: record keystroke and show password character UML reserves three activity labels: Entry: Triggers when a state is entered. Exit: Triggers when leaving a state. Do: Executes as long as a state is active.

Protocol State Machines Protocol state machines capture the behavior of a protocol, such as HTTP or a challenge response speak easy door. Protocol state machines differ from behavioral state machines in the following ways: entry, exit, and do activities can't be used. States can have invariants. Place invariants in square brackets under the state name.

The keyword protocol is placed in curly braces after the state machine name to indicate the state machine is a protocol state machine. Transitions in protocol state machines have a precondition, the trigger, and a post condition. The notation for a protocol transition is as follows: [precondition ] event / [postcondition ] Each transition is associated with zero or one operation on the owning classifier. Figure shows a simplified version of the Simple Mail Transport Protocol (SMTP) protocol.

Pseudostates Pseudostates are special types of states that represent specific behavior during transitions between regular states.

Event Processing Information within a state machine is conveyed via events. 1. Dispatch As events are triggered, they are added to an event pool. Once added to the event pool, events are sent out for processing by the state machine or are dispatched. The order of event dispatch and processing isn't specified by UML. This allows state machines to impose their own prioritization schemes on events if desired. 2. Deferred Events You can list events that should be deferred from dispatching while in a given state. You show a deferred event by listing the event, followed by a forward slash and the keyword defer within the state. Figure shows a state that defers the cancel event. If the cancel event does fire, it is held in the event pool until the state machine leaves this state.

Activity Diagrams

Terms and Concepts An activity diagram shows the flow from activity to activity. Common Properties An activity diagram is just a special kind of diagram and shares the same common properties as do all other diagrams a name and graphical contents that are a projection into a model. What distinguishes an interaction diagram from all other kinds of diagrams is its content. Contents : Activity states and action states Transitions Objects

Action States and Activity States In the flow of control modeled by an activity diagram, things happen. You might evaluate some expression that sets the value of an attribute or that returns some value. Alternately, you might call an operation on an object, send a signal to an object, or even create or destroy an object. These executable, atomic computations are called action states because they are states of the system, each representing the execution of an action. Figure :Action States

Branching You can include a branch, which specifies alternate paths taken based on some Boolean expression. As Figure shows, you represent a branch as a diamond. A branch may have one incoming transition and two or more outgoing ones. On each outgoing transition, you place a Boolean expression, which is evaluated only once on entering the branch

Forking and Joining When you are modeling workflows of business processes, you might encounter flows that are concurrent. In the UML, you use a synchronization bar to specify the forking and joining of these parallel flows of control. A synchronization bar is rendered as a thick horizontal or vertical line. For example, consider the concurrent flows involved in controlling an audioanimatronic device that mimics human speech and gestures.

As Figure shows, a fork represents the splitting of a single flow of control into two or more concurrent flows of control. A fork may have one incoming transition and two or more outgoing transitions, each of which represents an independent flow of control. Join represents the synchronization of two or more concurrent flows of control. A join may have two or more incoming transitions and one outgoing transition

Swimlanes Useful, especially when you are modeling workflows of business processes, to partition the activity states on an activity diagram into groups Each group representing the business organization responsible for those activities. In the UML, each group is called a swimlane because, visually, each group is divided from its neighbor by a vertical solid line. A swimlane specifies a flows of activities. Each swimlane has a name unique within its diagram

Object Flow Objects may be involved in the flow of control associated with an activity diagram As Figure shows, you can specify the things that are involved in an activity diagram by placing these objects in the diagram, connected using a dependency to the activity or transition that creates, destroys, or modifies them. This use of dependency relationships and objects is called an object flow because it represents the participation of an object in a flow of control.

In addition to showing the flow of an object through an activity diagram, you can also show how its role, state and attribute values change. As shown in the figure, you represent the state of an object by naming its state in brackets below the object's name. Similarly, you can represent the value of an object's attributes by rendering them in a compartment below the object's name.

Figure Object Flow