+ All Categories
Home > Documents > 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design...

13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design...

Date post: 17-Jan-2016
Category:
Upload: stephen-fleming
View: 216 times
Download: 0 times
Share this document with a friend
Popular Tags:
39
23.06.22 Object Oriented Analysis & Design & UML (Unified Modeling Language) 1 Part VI: Design Continuous Activity Diagams State Diagrams
Transcript
Page 1: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 1

Part VI: Design Continuous

Activity DiagamsState Diagrams

Page 2: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 2

Content Activity Diagams State Diagrams

Page 3: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

3

Activity Diagrams

Page 4: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 4

Activity Modeling a specialized type of behavioral

modeling concerned with modeling the activities and responsibilities of elements.

a special form of state machine to model the computations and workflow

Represents the state of execution not states of objects

applied in conjunction with sequence and collaboration modeling

Page 5: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 5

Activity Diagrams

widely used in analysis to model a use case flow flow between the use cases with no use of classes, objects, etc.

but also in design to model details of operation details of algorithm

Page 6: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

Using Activity Diagrams activity diagram can be

attached to any modeling element for the purpose of modeling the behavior of

that element. Activity diagrams are typically attached to

use cases classes interfaces components nodes collaborations operations and methods

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 6

Page 7: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 7

Action States Operation of Object Oriented systems

a society of objects Elements communicate with one another

each element has the responsibility of reacting to the communications it receives.

An action state processing as an element fulfills a responsibility

Example (the project management system states)

Project Manager Enters Report Criteria Project Management System Generates Report Printer Prints Report

Page 8: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 8

Types of action states Initial action state

the first action state A final action state

the last action state is shown using “a bull's eye”

An activity diagram may have only one initial action state, but may have any number of final action

states.

Page 9: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 9

Flow Transitions

shows how action states are ordered or sequenced.

Whenever an action or subactivity state finishes its work,

there is a transition out of the state into the next

state types of flow transitions:

control-flow object-flow transitions

Page 10: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 10

Control-Flow Transitions indicates

the order of action states Once a source action state

completes its processing, a target action state

starts its processing

Page 11: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 11

Example Control Flow Transitions

task of generating a report for the project management system

order of action states: The Project Manager Enters Report

Criteria The Project Management System

Generates Report The Printer Prints Report

Page 12: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 12

Control-flow transitions

Page 13: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 13

Default transitions Control-flow transitions

are also known as default transitions or automatic transitions,

because they are unlabeled and are immediately triggered

after the source action state completes processing.

Page 14: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 14

Decisions

A decision involves selecting one control-

flow transition out of many control-flow

transitions based upon a

condition

Page 15: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 15

Swimlanes a visual region in an

activity diagram Represents

use cases classes components organizational units

in business modeling roles

in workflow modeling indicates the element

has responsibility for action states within

the region

Page 16: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 16

Object-Flow Transitions Indicates an action

state input or output an

object can modify object

state An object-flow

transition is shown as

a dashed arrow between

an action state and an object. Activities may input and output objects and can modify object

state show this on an activity diagram as an object flow

Page 17: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 17

Types of Object-Flow Transitions

An action state uses an object as input: show with object-flow transition arrow Point

from the object to the action state.

An action state updates or produces an object: Show with the object-flow transition arrow Point

from the action state to the object

Page 18: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 18

Control-flow and object-flow transitions

Without unnecessary control-flow transitions

Page 19: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

Signals A signal is a way of representing

a package of information that is communicated asynchronously

between two objects.

A signal event occurs when an object receives a signal

When an event is received by an object it may trigger a state transition in it

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 19

Page 20: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

Sending & Receiving Signals

the signal called Order is sent to the :MailOrderCompa

ny external object we wait in the

signal receipt for a signal called

Goods delivered

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 20

Page 21: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

Signals are classifiers Modeled as stereotyped classes. The purpose of a signal is

to provide asynchronous communication of information

between objects and so, unlike ordinary classes,

they only have attributes and the single implicit operation

send(targetSet) allows them to be sent to a set of target objects. As this operation is implicit,

it is never actually shown on signal diagrams it is just assumed that it is there for every signal.

The signal attributes specify the information content of the signal

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 21

Page 22: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

Example: GUI events

a generalization hierarchy of raw GUI events modeled as signals

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 22

Page 23: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 23

Concurrency selecting multiple transitions simultaneously

Page 24: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

24

State Diagrams

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language)

Page 25: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 25

State Diagrams also known as

statechart diagrams state machines (in UML 2.0)

depict the lifecycle of elements that make up a system

State modeling is a specialized type of behavioral

modeling concerned with modeling

the lifecycle of an element

Page 26: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 26

States: Definition A state

is a condition of being at a certain time. is drawn as a rounded rectangle

with the name of the state in the center can be

a passive quality, Example: light object=> On and Off.

an active quality (object is doing something Example: Person => moving, sleeping, reading, … Example: coffeemaker => Brewing

Page 27: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 27

Simple States

indicates a condition or situation of an element.

Example: the project management system

Inactive is not available to its users, because it is not started or has been shut

down Active

started and available to its users Suspended

has encountered some severe error, Possible reason:

is running low on secondary storage requires user intervention

Page 28: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 28

Initial and Final States

Initial state the state of an element ,

when it is created. is shown with a small solid filled

circle. A final state

the state of an element when it is destroyed.

is shown with a circle surrounding a small solid

filled circle a bull's eye

Page 29: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 29

Transitions A transition,

shown with an arrow represents

a change of states from a source state to a

target state A transition description,

written along the arrow, describes the

circumstances causing the state change

to occur.

Page 30: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 30

Trigger A trigger is

an event cause a transition. Example: User input processing systems

a keystroke trigger may cause the system to change states

from Gathering input to Processing input.

Page 31: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 31

Transition Variations A trigger with no guard

the transition is taken when the trigger occurs.

This is useful for modeling a state change in response to an event.

A trigger with a guard the transition is taken

when the trigger occurs if the guard evaluates to true.

Otherwise, the transition isn't taken.

Combining a trigger and a guard is useful

for modeling a transition is blocked depending on a condition.

Neither a trigger nor a guard are specified,

the transition is taken immediately after the source state's internal

behavior

Page 32: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 32

The life cycle of an object

the life cycle of an AccountApplication object as it passes from pending to approved or rejected and then to finalizing

Page 33: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 33

Example how to use

State diagram modeling a troll in a FPS game FPS: first-person shooter

the troll's behavior is determined by his state

Page 34: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 34

Composite States A composite state is a state

contains one or more state diagrams. Each diagram belongs to a region,

regions are divided by a dotted line A state in a region is referred to as a

substate of the composite state. Composite states work as follows:

when the composite state becomes active, the initial pseudostate of each region becomes

active, and the contained state diagrams begin executing.

if a trigger on the composite state occurs The contained state diagrams are interrupted

Page 35: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 35

Composite States Example

Composite states contain one or more state diagrams; execute in parallel

Page 36: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 36

Advanced Pseudostates A choice pseudostate

used to emphasize a Boolean condition determines

which transition is followed. has guards

represented on outgoing transitions the transition depends on the guard.

Page 37: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 37

Fork and join pseudostates

show branching into concurrent states and then rejoining

Page 38: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 38

Signals transition-oriented view:

to draw attention to transitions and transition behavior using special icons for transitions.

Page 39: 13.12.2015 Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.

21.04.23 Object Oriented Analysis & Design & UML (Unified Modeling Language) 39

End of Chapter


Recommended