Page 70 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 70
Object Oriented Analysis and Design
Notes other objects (events). An action is an instantaneous operation. An action represents an operation
whose duration is insignificant compared to the resolution of the state diagram. For instance,
disconnect phone line might be an action in response to an on-hook event for the phone line. An
action is associated with an event.
6.1.5 Activity
Activity is an operation that takes time to complete. An activity is associated with a state.
Activity includes continuous operations such as displaying a picture on a television screen as
well as sequential operations that terminate by them after an interval of time such as closing a
valve or performing a computation. A state may control a continuous activity such as ringing a
telephone bell that persists until an event terminates it causing the transition of the state.
Activity starts on entry to the state and stops on exit.
Did u know? A state may control a sequential activity such as a robot moving a part that
progresses until it completes or until it is interrupted by an event that terminates
prematurely.
Task Make distinction between events and states.
Self Assessment
Fill in the blanks:
1. An individual stimulus from one object to another is an .......................
2. A ....................... is an abstraction of an object’s attribute values and links.
3. State that has substates is called a ....................... state.
4. A state corresponds to the interval between two events received by an object and describes
the “.......................” of the object for that time period.
5. A ....................... is a Boolean function of object values.
6. ....................... is an operation that takes time to complete.
6.2 State Diagrams
State diagrams are used to describe the behavior of a system. State diagrams describe all of the
possible states of an object as events occur. Each diagram usually represents objects of a single
class and tracks the different states of its objects through the system.
It relates events and states. A change of state caused by an event is called a transition. Transition
is drawn as an arrow from the receiving state to the target state. A state diagram is graph whose
nodes are states and whose directed arcs are transitions labeled by event names. State diagram
specifies the state sequence caused by an event sequence.
6.2.1 When to use State Diagrams
Use state diagrams to demonstrate the behavior of an object through many use cases of the
system. Only use state diagrams for classes where it is necessary to understand the behavior of
64 LOVELY PROFESSIONAL UNIVERSITY