Behavioral Models:
Basic Description
Behavioral Models illustrate the dynamic behavior of a system as it is executing, and how the system changes over time.
Behavioral Models:
Two Types of Stimuli
Data
Events
Behavioral Models:
Best Diagram for illustrating response to data
Sequence Diagram
Behavioral Models:
Best Diagram for illustrating response to Events
State Diagram
Behavioral Modeling Procedure
Steps
State Diagrams:
Important Concepts
State Diagrams:
State
Definition
A set if observable circumstances that characterize the behavior of a system at a given time
State Diagrams:
State Transition
Definition
The movement from one state to another
State Diagrams:
Event
Definition
An occurrence that causes the system to exhibit some predictable form of behavior
State Diagrams:
Action
Definition
Process that occurs as a consequence of making a transition
State Diagrams:
Hierarchical State
Parts of the system can often be organized into their own self contained state machines.
States are decomposed into these state machines in the diagram, with “smaller” related states being grouped into a larger “High Level” state.
Example:
On/Off switch transitions a device into the ON state, within the ON state, a switch determines some MODE state, but all possible MODE states are contained in the ON state.
Transitions are organized into High Level Transitions
State Diagram:
Basics of the Diagram
State Diagrams:
Event Driven Systems
State Diagrams:
State “Do” Activities
Represents concurrent work, or things that the program is actually “doing” within a state
Forks a concurrent thread that executes until:
Example:
Error
entry/printf(“error”)
do/while(true) alarm.ring()
State Diagrams:
Dynamic Conditional Branching
Instead of a single condition on a transition, there is a Dynamic Decision Point, represented by a white circle, with several possible transition paths branching off of it.
“Guards” with the various conditions are attached to each possible transition away from the Decision Point.
State Diagram:
Conditional Execution of Transitions
Transitions depend on meeting some condition while within the state.
This is represented with [Guards] that describe the condition to be met within square brackets
Guards have the format:
function[condition]/transition
Example:
bid[value<100]/reject
Sequence Diagrams:
Basic Description
Sequence Diagrams are used to model the interactions between actors and objects within the system.
Sequence Diagrams:
Data Driven Systems
Data Driven Systems
Primarily driven by a set of data.
They are controlled by data input into the system, with relatively little external event processing.
Sequence Diagrams are a good way to model these systems.
Activity Diagram:
Basic Description
Activity Diagram:
Components
Activity Diagrams:
When to Use
When Not to Use
Activity Diagrams:
Swim Lanes
Used to separate the diagram into different “zones”
Each Lane represents a different actor, part of the system, dept, etc.
Indicate with vertical dashed lines