OOAD ch5

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Chapter 5

State Modeling

5.1 Events
An event is an occurrence at a point in time, such as user presses left button or flight 132 departs from chicago. Events corresponds to verbs in past tense (power turned on, alarm set) or to the onset of some condition(paper tray becomes empty, temperature becomes lower ) An event happens instantaneously with regard to the time scale of an application.

One event may logically precede or follow another or the two events may be unrelated.
Flight 123 must depart Chicago before it can arrive in San Francisco Causally related Flight 123 may depart before or after flight 456 Causally unrelated Two events that are causally unrelated are said to be concurrent. They do not have effect on each other. Events include error conditions as well as normal occurrences such as motor jammed, transaction aborted.

5.1.1 Types of Events


signal event the change event the time event.

Signal event
A signal is an explicit one way transmission of information from one object to another. An object sending a signal to another object may expect a reply, but the reply is a separate signal under the control of the second object, which may or may not choose to send it. A signal event is the event of sending or receiving a signal. The difference between signal and signal event a signal is a message between objects while a signal event is an occurrence in time.

The UML notation is the keyword signal in (<<>>) above the signal class name)
<<signal>> FlightDeparture
Airline flightNumber City date

Change event
A change event is an event that is caused by the satisfaction of a boolean expression. The intent of a change event is that the expression is continually tested whenever the expression changes from false to true, the event happens. The UML notation for a change event is the keyword when followed by a paranthesized boolean expression.

when (room temperature < heating set point) when (room temperature > cooling set point) when battery power < lower limit) when (the pressure < minimum pressure) when (the attendance < 75)

Time Event
A time event is an event caused by the occurrence of an absolute time or the elapse of a time interval. The UML notation for an absolute time is the keyword when followed by a parenthesized expression involving time. The notation for a time interval is the keyword after followed by a parenthesized expression that evaluates to atime duration.

when (date = January 1, 2000) after (10 seconds)

You might also like