Sei sulla pagina 1di 11

UNIT – V

Advanced Behavioral Modelling: Events and signals, state machines, processes


and Threads, time and space, state chart diagrams.
Topic 1: Events and Signals
1) Define an event? (Specification of significant occurrence that has a location in
time and space)
2) How to model an event? (Anything that happens can be modeled as an event
in UML)
3) Events in state machines?( in state machines when an event occurs it triggers a
state transition)
4) What are external events? (Events which pass between system and its actors
are external events)
5) Example of external events? (in an ATM system, pushing a button or inserting
a card are external events)
6) What are internal events?(these are the events that pass among objects that
reside within a system)
7) Example for internal events?( over flow exception generated by an object )
9) What are synchronous events?( represents the invocation of an operation for
example calls)
10) What are asynchronous events?( that happen at arbitrary times for example
change of state, passing of time)
11) Diagram

1
12) Classification of types of events? (4 types 1)Signals 2) Call Events
3) Time Events 4) Change of state events
5) Sending / Receiving Events)
Signal Events
1) What is a signal?( named object that is sent asynchronously by one object and
then received by another)
2) Examples for signals?(exceptions are famous example for signals)
3) How a signal can be sent? (as a message in an interaction or as an action of a
state in a state machine)
4) Define a Signal? (it is an event that represents specification of an
Asynchronous stimulus (a thing or event that evokes a specific
functional reaction) communicated between instances)
5) What type of events signals are?(asynchronous events)
6) What the signal events may have? (Instances, generalization relationships,
attributes and operations, explicit list of
parameters send by one object to another)

2
7) How we can model the relationship between an operation and events?( using
Dependency stereotyped with “send” which
indicates that an operation sends a
particular signal)
8) Diagram for modeling relationship

9) Diagram2

Call Events
1) What a call event represents?(dispatch of an operation from one object to
another)
2) What a call event triggers?(it triggers a state change in a state machine)
3) What type of event it is ? (it is a synchronous event)

3
4) What is a synchronous event? (sender object must wait until it gets
acknowledgement from the receiver object
which receives the call event)
5) Explain procedure involved in synchronous events?
when an object invokes an operation on another object , the control passes from
the sender to the receiver , the transition is triggered by the event , once the
operation is completed , the receiver transitions to a new state and then the control
returns to sender
5) Example for synchronous event?(state of a customer in an ATM application)
6) Diagram

7) Diagram 2

Time Events
1) What is a time event? (it is an event which represents passage of time)
2) How a time event is modeled in UML? (By using key word “after” followed by
some expression)
3) What an expression evaluates?( to a period of time which can be simplex or
complex)

4
4) Example? (after 2 seconds or after 1ns since existing Idle)
Change Events
1) What is a change event? (Which represents a change in sate or some satisfying
condition)
2) What type of condition it may be? (Boolean condition)
3) What this event implies?( a continuous test for the condition)
4) When this event occurs? (When a condition changes from false to true)
5) Diagram

Sending and Receiving Events


1) What an instance of a class can receive? (a call event or a signal)
2) What happens when an instance receives a synchronous call event?(
the sender is in locked state with the receiver )
3)What procedure is involved in synchronous call event?(the sender and receiver
are in rendezvous i.e the sender dispatches
the signal and wait for a response from the
receiver )
4) What happens when an instance receives a signal?(sender is free to carry its
Operations without any concern on the receiver)

5
5) What procedure involved in receiving a signal event?( The sender and receiver
do not rendezvous)
The sender dispatches the signal but does not wait for a response from the receiver,
when an object sends a signal, the sender dispatches the signal and then continues
along its flow of control, not waiting for any return from the receiver
6)Diagram

Common Modeling Techniques


1) What are the common modeling techniques used in signals? (two 1)modeling
a family of signals 2)modeling exceptions)
Modeling a family of signals
1) What are the various steps involved ?(considering all signals, arranging signals
in hierarchy,look out for polymorphism)

1. Consider all the signals to which a set of objects can respond.


2. Arrange these signals in a hierarchy using generalization-specialization
relationship.
3. Look out for polymorphism in the state machine of the active objects. When
polymorphism is found, adjust the hierarchy by introducing intermediate abstract
signals.

6
2) Diagram

Modeling Exceptions
1)What steps are involved in modeling exceptions?(
1)identify exceptions conditions that can be raised
2)arrange exceptions in hierarchy like
general,specifalized and intermediate
3)specify exceptions for each operation)

2)Diagram

7
8
Topic -2
State Machines
1) What is a state machine? (It is a behavior)
2) What this behavior represents? (Sequences of states than an object undergo
during its life time in response to events)
3) Why we use state machine? (To model the behavior of an object
To model the behavior of entire system
To emphasize the flow of control between objects
To emphasize the transitions among the state
)
4) What an object may be exposed during its life time? (
1. Creation of an object
2. Destruction of an object
3. Change of state of an object
4. Message Passing
5. Objects may respond to an event
With actions)
5) Example for responding to an event ?(if we insert ATM card into the machine ,
then the ATM will respond with a
query “enter your PIN number)
States
1) Define a state? (it is a condition or situation during the life of an object)
2) What an object does during its life?( satisfies some condition,
performs some activity,
waits for an event)

9
3) How long an object stays in a state?(for a finite amount of time)
4) Example? (Heater in home may remain in any four states
Idle, Activating, Active, Shutting Down)
5) Name of a state? (must be unique within its enclosing state)
6) How many parts a state may have?(5 parts)
7) What are the various parts of a state?
(name,actions,transitions,substates,events)
1) Every state will be identified with its
textual name
2) Every state will have an Entry and Exit
Level actions
3) Every state will have transitions which
are relationships between states
4) Nesting of states leads to sub states
5)Every state will have events which are
transmission of message from one object to
another object)

10
11

Potrebbero piacerti anche