Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
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
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