Unit-2 Dynamic Modeling
Unit-2 Dynamic Modeling
AND DESIGN
CHAPTER- 2
DYNAMIC & FUNCTIONAL MODELING
DYNAMIC MODEL
2
DYNAMIC MODELING
4
EVENTS AND STATES
The attribute values and links held by an object are called its state.
An individual stimulus from one object to another is an event.
Response to an event depends on the state of the object receiving it.
Response can include a change of state or the sending of another event
to the original sender or to a third object.
The pattern of events , states and state transitions for a given class can
be abstracted and represented as a state diagram.
The dynamic model consists of multiple state diagrams , one state
diagram for each class with important dynamic behavior, and shows
pattern of activity for an entire system.
5
EVENTS
7
Every event is a unique occurrence, but we group them into
event classes and give each event class a name to indicate
common structure and behavior.
This structure is hierarchical as class structure.
E.g. flight 123 departs from Delhi and flight 321 departs from
Rome are instances of event class airplane flight departs
having attributes airline,flight no, city.
The time at which an event occurs is an implicit attribute of
all events.
8
An event conveys information from one object to
another.
Some classes of events may be simply signals that
something has occurred while other convey data values
i.e. attributes.
Showing attributes is optional.
Events include error conditions as well as normal
occurrences.
9
Fig.1 Event classes and attributes
10
SCENARIOS AND EVENT TRACES
15
A state has duration; it occupies interval of time.
A state is often associated with either continuous activity or activity that
takes time to complete.
An event separates two states and a state separates two events.
In defining states we ignore those attributes that do not affect the behavior
of the objects.e.g balance is only attribute that causes state change. So we
can ignore the acc_ID and acc_type attributes of Account object.
Both events and states depends on the level of abstraction used. E.g for bank
customer credit or debit is single event; but for bank system it is sequence
of many operations.
16
STATE DIAGRAM
17
State diagrams can represent one-shot life cycles or
continuous loops.
Continuous state diagrams do not have any initial states
and final states. E.g. state diagram for phone line.
One-shot state diagrams represent objects with finite lives
and have initial and final states. The initial state is entered
on creation of an object; entering the final state implies the
destruction of object.
19
ONE-SHOT STATE DIAGRAM
The dynamic model is collection of state diagrams
that interact with each other via shared events.
21
CONDITIONS
23
OPERATIONS
25
An action is an instantaneous operation.
An action is associated with an event.
An action represents an operation whose duration is insignificant
compared to the state diagram e.g. disconnect phone line might be an
action in response to an on_hook event for phone line.
Actions can also represent internal control operations such as setting
attributes or generating other events.
The notation for an action is (“/”) and the name of action, following the
name of the event that causes it.
26
ACTION FOR POP-UP MENU
SUMMARY OF NOTATION FOR
UNSTRUCTURED STATE DIAGRAM
28
NESTED STATE DIAGRAM
30
PROBLEMS WITH FLAT STATE DIAGRAMS
31
NESTING STATE DIAGRAMS
32
STATE GENERALIZATION
36
EVENT GENERALIZATION
A state diagram for assembly is collection of state diagrams , one for each
component
Aggregation implies concurrency
The aggregate state corresponds to the combined state of all the component
diagrams
Aggregation is the “ and-relationship”
AGGREGATION AND ITS CONCURRENT
STATE DIAGRAM
AGGREGATION AND ITS CONCURRENT
STATE DIAGRAM
CONCURRENCY WITHIN AN OBJECT
It arises when the object can be partitioned into subsets of attributes or links,
each of which has its own subdiagram
The state of the object comprises the one state from each subdiagram
The subdiagrams need not be independent; same event can cause transition in
more than one subdiagram
Notation
o Composite state is partitioned into subdiagrams with dotted line
o Name of the overall composite state is written in separate region of the box,
separated by solid line from concurrent state diagrams
CONCURRENCY WITHIN AN OBJECT
ADVANCED DYNAMIC MODELLING
CONCEPTS