UML: Behavioral Models Flashcards

1
Q

Behavioral Models:

Basic Description

A

Behavioral Models illustrate the dynamic behavior of a system as it is executing, and how the system changes over time.

  • Shows what happens when a system responds to stimuli from the environment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Behavioral Models:

Two Types of Stimuli

A

Data

Events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Behavioral Models:

Best Diagram for illustrating response to data

A

Sequence Diagram

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Behavioral Models:

Best Diagram for illustrating response to Events

A

State Diagram

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Behavioral Modeling Procedure

Steps

A
  1. List the possible states of a system
    • How does the system behave?
  2. Indicate HOW the system transitions from one state to another
    • Indicate the triggering event/change
    • Indicate the action taken by the system
  3. Draw a State Diagram or Sequence Diagram
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

State Diagrams:

Important Concepts

A
  • States
    • State machines
    • State Hierarchy/Decomposition
  • Transitions
    • Conditional Branching
    • Guards
    • Decision Points
  • Events
  • Actions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

State Diagrams:

State

Definition

A

A set if observable circumstances that characterize the behavior of a system at a given time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

State Diagrams:

State Transition

Definition

A

The movement from one state to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

State Diagrams:

Event

Definition

A

An occurrence that causes the system to exhibit some predictable form of behavior

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

State Diagrams:

Action

Definition

A

Process that occurs as a consequence of making a transition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

State Diagrams:

Hierarchical State

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

State Diagram:

Basics of the Diagram

A
  • Each State is represented with a labeled box
  • Transitions between states are indicated with a labeled arrow
  • The Initial State is indicated with a black circle, connected to the initial state with an arrow, called the “State Entry”
  • The conditions determining transitions are represented with either:
    • “Guards” labeled on the transition line
    • Decision Points, which are not quite states but can direct the transition to multiple different states, represented with a white circle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

State Diagrams:

Event Driven Systems

A
  • Real-time systems are often event-driven with minimal data processing
  • Event Driven Modeling shows how a system responds to external and internal events
  • Event-Driven Modeling is based on the assumption that a system has a finite number of states and that events may cause a state-transition
    • Treat the system like a state machine
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

State Diagrams:

State “Do” Activities

A

Represents concurrent work, or things that the program is actually “doing” within a state

Forks a concurrent thread that executes until:

  • The action is completed
  • The state is exited through an outgoing transition

Example:

Error

entry/printf(“error”)

do/while(true) alarm.ring()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

State Diagrams:

Dynamic Conditional Branching

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

State Diagram:

Conditional Execution of Transitions

A

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

17
Q

Sequence Diagrams:

Basic Description

A

Sequence Diagrams are used to model the interactions between actors and objects within the system.

  • Shows the sequence of interactions that take place during a particular Use Case
  • Each Sequence is for a single Use Case
  • Suitable for describing Data-Driven Systems
  • Uses columns to represent Actors and Objects
  • “Triggers” with “Guards” representing interactions
  • Actors/Entities organized from Left to Right, Time represented from top to bottom
18
Q

Sequence Diagrams:

Data Driven Systems

A

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.

19
Q

Activity Diagram:

Basic Description

A
  • Illustrates the control flow of activites in a specific scenario
  • Activities are represented by Boxes
  • An Activity can refer to user tasks or class methods, depending on the intended perspective
  • Links between activities are Triggers, with Guards to check conditions
  • An Activity can have multiple Triggers
  • There can be concurrent Activities
  • Flow begins with a “Start” black circle
  • Flow ends with a concentric white and black “End”
20
Q

Activity Diagram:

Components

A
  • Activity Box
  • Decision Activity Diamonds
  • Start Circle
  • End Circle
  • Triggers
  • Guards
  • Synchronization Bar
  • Swim Lanes
21
Q

Activity Diagrams:

When to Use

When Not to Use

A
  • Show behavior that spans over multiple Use Cases, to describe workflow of the overall process
  • For multiple objects and their high-level interaction
    • Activity Diagrams are particularly helpful for representing an overview of concurrent processes
  • Do NOT Use to see how objects collaborate
  • They are NOT accurate for describing how an object behaves over it’s lifetime
22
Q

Activity Diagrams:

Swim Lanes

A

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