0% found this document useful (0 votes)
200 views24 pages

3.1.advanced State Modeling Concepts

1) Nested state diagrams allow modeling complex systems in a more structured way compared to flat state diagrams. This includes nesting state diagrams within states and representing states as composite states that can contain nested substates. 2) Signal generalization organizes signals in a hierarchy with inheritance of attributes, allowing different levels of abstraction. 3) Concurrency can be modeled using aggregation of state diagrams for different objects or partitioning composite states into concurrent subdiagrams to represent independent behavior within an object.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
200 views24 pages

3.1.advanced State Modeling Concepts

1) Nested state diagrams allow modeling complex systems in a more structured way compared to flat state diagrams. This includes nesting state diagrams within states and representing states as composite states that can contain nested substates. 2) Signal generalization organizes signals in a hierarchy with inheritance of attributes, allowing different levels of abstraction. 3) Concurrency can be modeled using aggregation of state diagrams for different objects or partitioning composite states into concurrent subdiagrams to represent independent behavior within an object.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Unit - 2

CSE307
Object Oriented Analysis & Design

Advanced State Modeling

1
Introduction
• Conventional state diagrams are
sufficient for describing simple systems.
• But need additional power to handle
large problems.

2
Introduction
• You can more richly model complex
systems by using:
– Nested state diagrams,
– Nested states,
– Signal generalization, and
– Concurrency.

3
Nested state diagrams
• State diagrams are impractical for large problems especially
when they become flat and unstructured.

Flat State Diagram

4
Nested state diagrams
• Consider an object with n independent Boolean
attributes that affect control.
• Representing such an object with a single flat
state diagram would require 2n states.
• An object with 3 Boolean attributes can be drawn
using flat state diagram :
• No of states will be : 2n ; n=3; 6 states with n2
transitions ; 9 transitions.

5
Expanding States
• One way to organize a model is by having a
high-level diagram with sub diagrams
expanding certain states.
• A submachine is a state diagram that may be
invoked as part of another state diagram.

6
Nested State Diagrams
• An activity in a state can be expanded as a
lower level state diagram
• Nested activities are one shot diagrams with
input and output transitions, like subroutines.
• The following diagram shows a top-level
model for a vending machine.

7
High level vending machine model

SubMachine

8
High level vending machine model

9
Nested States
• Composite State:
– Entirely encloses the nested states.
– it’s a name label of outer contour(form) that encloses
the nested state
– A nested state receives the outgoing transitions of its
composite state.
• Example:
– Nested states refines values and link that object can
have.
– In phone line diagram, all state except idle are
nested state as active.

10
Nested states for a phone line : A nested state receives
the outgoing transitions of its enclosing state.

Active is a composite
state with regard to
nested states
DialTone, Timeout and
Dialing

11
Nested States:
An automobile automatic transmission
• The transmission can be reverse, neutral or
forward
• Forward first, second and third gears

12
Nested state diagrams
• State diagrams can be structured to permit
concise descriptions of complex systems.
• It allows generalization and aggregation
• Generalization is equivalent to expanding
nested activities.
• Aggregation allows concurrency of states.

13
Signal Generalization
• you can organize signals into a generalization
hierarchy with inheritance of signal attributes.
• A signal hierarchy permits different levels of
abstraction to be used at different places in a
model.

14
Signal Generalization

15
Concurrency
• Object can act and change state independent
of one another.
• Sometime objects shares constraints that
causes their state changes
• A state diagram for an assembly is a collection
of state diagrams.

16
Concurrency
1. Aggregation Concurrency
• second State Aggregation means collection of state diagram ,
one for each part
• Aggregate state is one state from first diagram and a state
from diagram and state from each other diagram.

17
An aggregation and its concurrent state diagrams

The state
diagram for an
assembly is a
collection of
state diagrams

18
Concurrency
2. Concurrency within an object
• Some objects can be partitioned into subsets of
attributes or links.
• Concurrency within a single state of an object
shown by partitioning the composite state into
sub diagram with dotted lines.
• The name of the state can be written in a
separate region of the box, separated by a solid
line
19
Sample State Diagram:
Programmable thermostat

20
Sample State Diagram:
Programmable
thermostat

21
Sample State Diagram:
Programmable
thermostat

22
Relation of Class and
State Models
• The state model specifies allowable sequences of
changes to objects from the class model.
• A state diagram describes all or part of the behaviour
of the objects of a given class.
• Both generalization of classes and nesting of states
partition the set of possible object values.
• A composite state is the aggregation of more than one
concurrent substate.
– There are three sources of concurrency within the class
model.
– aggregation of objects , aggregation within an object,
concurrent behavior of an object

23
Relation of Class and
State Models
• The subclasses can have their own state
diagrams
• The state diagram of the subclass involves
some of the same attributes as the state
diagram of the super class.
• The subclasses can have their own state
diagrams.
• Transitions can often be implemented as
operations on objects.
24

You might also like