Www.techstudent.co.cc State Modeling. www.techstudent.co.cc Events An event is an occurrence at a point in time, such as user depresses left button or.

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

State Charts Mehran Najafi. Reactive Systems A reactive, event-driven, object is one whose behavior is best characterized by its response to events dispatched.
Nested state diagrams:Problems with flat state diagram
Karolina Muszyńska Based on:
UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Software Engineering COMP 201
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
© Copyright Eliyahu Brutman Programming Techniques Course.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
 What is Interaction Modelling What is Interaction Modelling  Use Case Models Use Case Models Actor Use cases Use Case Diagram Symbols Use case Diagram.
SE-565 Software System Requirements More UML Diagrams.
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
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.
Interaction Modeling Interaction model describes how objects interact to produce useful results. Interactions can be modeled at different levels of abstraction:
Interaction Modeling. Overview The class model describes the objects in a system and their relationships, the state model describes the life cycles of.
Interaction Modeling. Introduction (1) Third leg of the modeling tripod. It describes interaction within a system. The class model describes the objects.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
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.
Systems Analysis and Design in a Changing World, Fifth Edition
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Interaction Modeling Extracted from textbook:
Interaction Models (2): Sequence Diagrams Extracted from textbook: Object Oriented Modeling and Design with UML M. Blaha, J. Rumbaugh 1.
Requirements as Usecases Capturing the REQUIREMENT ANALYSIS DESIGN IMPLEMENTATION TEST.
Chapter 5 Models and UML Notation for The Object-Oriented Approach.
1 State Modeling  Events  States  Transitions and Conditions  State Diagrams  State Diagram Behavior  Practical Tips.
Activity diagrams. Introduction ● Activity diagrams are a behavioural model that represent the dynamics of the system. ● An activity diagram is essentially.
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.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Sequence Models.
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
1 Modeling System Requirements with Use Cases. 2 Why Do We Need Use Cases? Primary challenge in a system design process –ability to elicit correct and.
1 Version /05/2004 © 2004 Robert Oshana Requirements Engineering Use cases.
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”
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
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.
Systems Analysis and Design in a Changing World, Fourth Edition
 Building Block Building Block  Things in the UML Things in the UML  Structural Things Structural Things  Behavioral Things Behavioral Things  Grouping.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
Chapter 3: Introducing the UML
UML - Development Process 1 Software Development Process Using UML.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Use Case Diagrams. Introduction In the previous Lecture, you saw a brief review of the nine UML diagrams. Now that you have the clear, you'll start to.
Appendix Object-Oriented Analysis and Design: Use Cases and Sequence Diagrams Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Application Analysis. Application Interaction Model The purpose of analysis is to understand the problem so.
Module 2 OOMD.
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
Business Process and Functional Modeling
Appendix 3 Object-Oriented Analysis and Design
Analysis Classes Unit 5.
Chapter 8 Advanced Interaction Modeling
COMPONENT & DEPLOYMENT DIAGRAMS
Unified Modeling Language
Subject Name: Object oriented Modeling and Design
Business System Development
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
BPMN - Business Process Modeling Notations
Interaction Modeling Extracted from textbook:
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

State Modeling

Events An event is an occurrence at a point in time, such as user depresses left button or flight 123 departs from Chicago. By definition, an event happens instantaneously with regard to the time scale of an application. One event may logically precede or follow another or two events may be unrelated. An event is an occurrence at a point in time, such as user depresses left button or flight 123 departs from Chicago. By definition, an event happens instantaneously with regard to the time scale of an application. One event may logically precede or follow another or two events may be unrelated. A signal is an explicit one-way transmission of information from one object to another. It is different from a subroutine call that returns a value. A signal event is the event of sending or receiving a signal. A change event is an event that is caused by satisfaction of boolean expression. A signal is an explicit one-way transmission of information from one object to another. It is different from a subroutine call that returns a value. A signal event is the event of sending or receiving a signal. A change event is an event that is caused by satisfaction of boolean expression.

States A state is an abstraction of the values and links of an object. Sets of values and links are grouped together into a state according to the gross behavior of objects. A state is an abstraction of the values and links of an object. Sets of values and links are grouped together into a state according to the gross behavior of objects. Events and States Events and States

Transitions and Conditions A transition is an instantaneous change from one state to another. The transition is said to fire the change from the source state to the target state. The origin and target of a transition usually are different states, but may be same. A transition fires when its event occurs. The choice of next state depends on both the original state and the event received. An event may cause multiple objects to transitions. A transition is an instantaneous change from one state to another. The transition is said to fire the change from the source state to the target state. The origin and target of a transition usually are different states, but may be same. A transition fires when its event occurs. The choice of next state depends on both the original state and the event received. An event may cause multiple objects to transitions. A guard condition is a boolean expression that must be true in order for a transition to occur. A guard condition fire when its event occurs, but only if the guard condition is true. “when you wake up in the morning (event), if the temperature is below freezing (condition), then put on your gloves ( next state) A guard condition is a boolean expression that must be true in order for a transition to occur. A guard condition fire when its event occurs, but only if the guard condition is true. “when you wake up in the morning (event), if the temperature is below freezing (condition), then put on your gloves ( next state)

State Diagrams A State diagram is a graph whose nodes are states and whose directed arcs are transitions between states. A state diagram specifies the state sequence caused by event sequences. State names must be unique within the scope of a state diagram. All objects in a class execute the state diagram for that class, which models their behavior. The state diagram consists of multiple diagrams, one state diagram for each class with important temporal behavior. A state diagram must match their interface-events and guard conditions. A State diagram is a graph whose nodes are states and whose directed arcs are transitions between states. A state diagram specifies the state sequence caused by event sequences. State names must be unique within the scope of a state diagram. All objects in a class execute the state diagram for that class, which models their behavior. The state diagram consists of multiple diagrams, one state diagram for each class with important temporal behavior. A state diagram must match their interface-events and guard conditions.

State Diagrams State diagrams are used to describe the behavior of a system. State diagrams describe all of the possible states of an object as events occur. State diagrams are used to describe the behavior of a system. State diagrams describe all of the possible states of an object as events occur. Each diagram usually represents objects of a single class and track the different states of its objects through the system Each diagram usually represents objects of a single class and track the different states of its objects through the system State diagram for a class shows the states that objects of that class may assume and the transitions the objects may make from state. State diagram for a class shows the states that objects of that class may assume and the transitions the objects may make from state.

Basic State Diagrams State diagrams have very few elements. The basic elements are rounded boxes representing the state of the object and arrows indicting the transition to the next state. The activity section of the state symbol depicts what activities the object will be doing while it is in that state State diagrams have very few elements. The basic elements are rounded boxes representing the state of the object and arrows indicting the transition to the next state. The activity section of the state symbol depicts what activities the object will be doing while it is in that state

Basic State Diagrams All state diagrams being with an initial state of the object. This is the state of the object when it is created. After the initial state the object begins changing states. Conditions based on the activities can determine what the next state the object transitions to. All state diagrams being with an initial state of the object. This is the state of the object when it is created. After the initial state the object begins changing states. Conditions based on the activities can determine what the next state the object transitions to.

Basic State Diagrams An Example An Example

State Diagram for a telephone line

Nested State Diagrams State diagrams can also show a super-state for the object. A super-state is used when many transitions lead to the a certain state. Instead of showing all of the transitions from each state to the redundant state a super-state can be used to show that all of the states inside of the super- state can transition to the redundant state. This helps make the state diagram easier to read State diagrams can also show a super-state for the object. A super-state is used when many transitions lead to the a certain state. Instead of showing all of the transitions from each state to the redundant state a super-state can be used to show that all of the states inside of the super- state can transition to the redundant state. This helps make the state diagram easier to read

Nested State Diagrams Both the Checking and Dispatching states can transition into the Canceled state, so a transition is shown from a super-state named Active to the state Cancel. By contrast, the state Dispatching can only transition to the Delivered state, so we show an arrow only from the Dispatching state to the Delivered state Both the Checking and Dispatching states can transition into the Canceled state, so a transition is shown from a super-state named Active to the state Cancel. By contrast, the state Dispatching can only transition to the Delivered state, so we show an arrow only from the Dispatching state to the Delivered state

Nested State Diagrams A State of Washing Machine A State of Washing Machine

Concurrent States and Synchronization This covers the concurrent states that an object may have and goes deeper into the topic of nested states. Activity diagrams describe the workflow behavior of a system. This covers the concurrent states that an object may have and goes deeper into the topic of nested states. Activity diagrams describe the workflow behavior of a system. Activity diagrams are similar to state diagrams, because activities are the state of doing something. The diagrams describe the state of activities by showing the sequence of activities performed. Activity diagrams can show activities that are conditional or parallel. Activity diagrams are similar to state diagrams, because activities are the state of doing something. The diagrams describe the state of activities by showing the sequence of activities performed. Activity diagrams can show activities that are conditional or parallel. Activity diagrams should be used in conjunction with other modeling techniques such as interaction diagrams and state diagrams. Activity diagrams should be used in conjunction with other modeling techniques such as interaction diagrams and state diagrams.

Concurrent States and Synchronization This covers the concurrent states that an object may have and goes deeper into the topic of nested states. Activity diagrams describe the workflow behavior of a system. This covers the concurrent states that an object may have and goes deeper into the topic of nested states. Activity diagrams describe the workflow behavior of a system. 1

Concurrent States and Synchronization

Concurrent States and Synchronization The diagram shows the flow of actions in the system's workflow. Once the order is received the activities split into two parallel sets of activities. One side fills and sends the order while the other handles the billing. On the Fill Order side, the method of delivery is decided conditionally. Depending on the condition either the Overnight Delivery activity or the Regular Delivery activity is performed. Finally the parallel activities combine to close the order The diagram shows the flow of actions in the system's workflow. Once the order is received the activities split into two parallel sets of activities. One side fills and sends the order while the other handles the billing. On the Fill Order side, the method of delivery is decided conditionally. Depending on the condition either the Overnight Delivery activity or the Regular Delivery activity is performed. Finally the parallel activities combine to close the order

Concurrent States and Synchronization Example: Washing Machine Example: Washing Machine

Concurrency The state model implicitly supports concurrency among objects, In general, objects are autonomous entities that can act and change state independent of one another. Objects need not be completely independent and may be subject to shared constraints that cause some correspondence among their state changes. The state model implicitly supports concurrency among objects, In general, objects are autonomous entities that can act and change state independent of one another. Objects need not be completely independent and may be subject to shared constraints that cause some correspondence among their state changes. Aggregation concurrency: the aggregate state corresponds to the combined states of all parts. Aggregation is the “and-relationship”. The aggregate state is one state from the first diagram and the state from the second diagram and a state from each other diagram. Aggregation concurrency: the aggregate state corresponds to the combined states of all parts. Aggregation is the “and-relationship”. The aggregate state is one state from the first diagram and the state from the second diagram and a state from each other diagram.

The state of a CAR as an aggregation of part states The state of a CAR as an aggregation of part states

You can partition some objects into subsets of attributes or links each of which has its own sub diagram You can partition some objects into subsets of attributes or links each of which has its own sub diagram

Sometimes one object must perform two (or more) activities concurrently. The objects does not synchronize the internal steps of the activities but must complete both activities before it can progress to its next state. Sometimes one object must perform two (or more) activities concurrently. The objects does not synchronize the internal steps of the activities but must complete both activities before it can progress to its next state.

Interaction Modeling Interaction model is the third leg of the modeling tripod and describes interactions with in a system. The class model describes the objects in the system and their relationships. The state model describes the life cycles of the objects. Interaction model is the third leg of the modeling tripod and describes interactions with in a system. The class model describes the objects in the system and their relationships. The state model describes the life cycles of the objects. The interaction model describes how the objects interact to produce useful results. Interaction can be modeled at different levels of abstraction. At high level use cases describes how a system interacts with outside actors. Each use case represents a piece of functionality that a system provides to its users. Use cases are helpful for capturing informal requirements. The interaction model describes how the objects interact to produce useful results. Interaction can be modeled at different levels of abstraction. At high level use cases describes how a system interacts with outside actors. Each use case represents a piece of functionality that a system provides to its users. Use cases are helpful for capturing informal requirements.

Interaction Modeling Sequence diagram provide more detail and show the messages exchanged among a set of objects over time. Messages include both asynchronous signals and procedure calls. Sequence diagrams are good for showing the behavior sequences seen by users of a system Sequence diagram provide more detail and show the messages exchanged among a set of objects over time. Messages include both asynchronous signals and procedure calls. Sequence diagrams are good for showing the behavior sequences seen by users of a system Activity diagrams provide further detail and show the flow of control among the steps of computation. Activity diagrams can show data flows as well as control flows. Activity diagrams document the steps necessary to implement an operation or a business process referenced in a sequence diagram. Activity diagrams provide further detail and show the flow of control among the steps of computation. Activity diagrams can show data flows as well as control flows. Activity diagrams document the steps necessary to implement an operation or a business process referenced in a sequence diagram.

Use Case Models A use case is a set of scenarios that describing an interaction between a user and a system. A use case diagram displays the relationship among actors and use cases. The two main components of a use case diagram are ‘use cases’ and ‘actors’. An actor is a direct external user of a system. An actor represents a user or another system that will interact with the system you are modeling. Each actor represents those objects that behave in a particular way toward the system. For example, customer and repair technician are different actors for a vending machine. An actor is a person, organization, or external system that plays a role in one or more interactions with your system

Use Case Models The various interactions of actors with a system are quantized into use cases. A use case is an external view of the system that represents some action the user might perform in order to complete a task. A use case describes a sequence of actions that provide something of measurable value to an actor and is drawn as a horizontal ellipse. A use case is a coherent piece of functionality that a system can provide by interacting with actors.

Use Case Diagram A system involves a set of use cases and a set of actors. Each use case represents a slice of the functionality the system provides. The set of use cases shows the complete functionality of the system at level of detail. Similarly, each actor represents one kind of object for which the system can perform behavior. The set of actors represents the complete set of that the system can serve. The are helpful in exposing requirements and planning the project. During the initial stage of a project most use cases should be defined, but as the project continues more might become visible.

Use case diagram for a vending machine

Guidelines for Use Case Models First determine the system boundary. Ensure that actors are focused. Each use case must provide value to users. Relate use cases and actors. Remember that use cases are informal. Use cases can be structured.

Sequence Models The sequence model elaborates the themes of use cases. There are two kinds of sequence models: Scenarios and a more structured format called sequence diagrams. A usage scenario is a description of a potential way your system is used. The logic of a usage scenario may be part of a use case, perhaps an alternate course. It may also be one entire pass through a use case, such as the logic described by the basic course of action or a portion of the basic course of action, plus one or more alternate scenarios. The logic of a usage scenario may also be a pass through the logic contained in several use cases. For example, a student enrolls in the university, and then immediately enrolls in three seminars

Sequence Diagram A scenario can be displayed as a list of text statements. Sequence Diagram A Sequence diagram depicts the sequence of actions that occur in a system. The invocation of methods in each object, and the order in which the invocation occurs is captured in a Sequence diagram. This makes the Sequence diagram a very useful tool to easily represent the dynamic behavior of a system. It shows the participants in an interaction and the sequence of messages among them. Also it shows the interaction of a system with its actors.

Sequence Diagram

Sequence Diagram Guidelines for sequence models The sequence model adds detail and elaborates the informal themes of use cases. Scenario document a sequence of events with prose. Sequence diagrams also document the sequence of events but more clearly show actors involved. Prepare at least one scenario per use case. Abstract the scenario into sequence diagrams Divide complex interactions. Prepare a sequence diagram for each error condition.

Advanced Interaction Modeling Use Case Relationships It can be helpful to structure use cases for large applications. Complex use cases can be built from smaller pieces with the include, extend and generalization relationships Include Relationship The Include relationship incorporates one use case within the behavior sequence of another use case. An include use case is like a subroutine. It represents behavior that would otherwise have to be described repeatedly. The representation is a dashed arrow from source to destination. The keyword > annotates the arrow.

Advanced Interaction Modeling

Advanced Interaction Modeling Extend Relationship The extend relationship adds incremental behavior to a use case. It is like an include relationship looked at from the opposite direction, in which the extension adds itself to the base, rather than the base explicitly incorporating the extension. It represents some frequent situations in which some initial capability is defined, and later features are added modularity. The include and extend relationship both add behavior to a base use case.

Advanced Interaction Modeling Extend Relationship

Advanced Interaction Modeling Generalization In UML modeling, a generalization relationship is a relationship in which one model element (the child) is based on another model element (the parent). A generalization is used to indicate inheritance. Generalization relationships are used in class, component, deployment, and use case diagrams. A parent use case represents a general behavior sequence. Child use case specializes the parent by inserting additional steps of by refining steps.

Procedural Sequence Models Sequence Diagram with passive objects Sequence Diagram with transient object Special Constructs for Activity Models Sending and receiving signals Swimlanes Swimlanes can show organizational responsibility for activities Object Flows

Procedural Sequence Models Sequence Diagram with passive objects

Procedural Sequence Models Sequence Diagram with transient object

Special Constructs for Activity Models Sending and receiving signals

Special Constructs for Activity Models Swimlanes Swimlanes can show organizational responsibility for activities

Special Constructs for Activity Models Object Flows