TAW_12 Chapter 5, Object-Oriented Events Flashcards
Events can have Import and Export parameters?
No, Events can only have export parameters
There are instance and class (static events?
True
In UML, how are events depicted
Under a solid line that separates the methods from events
Under <>
+ On_vehicle_created( )
{ for event = vehicle_created of lcl_vehicle }
T or F, static events can only be called by static methods?
False, instances can raise static events
Can instance constructors trigger events?
Yes
Give an example of a handler event signature
METHODS on_vehicle_create FOR EVENT vehicle_create of lcl_vehicle importing sender
What are the two ways a handler method can be triggered?
By RAISE EVENT or CALL METHOD
Static methods can only trigger static events?
True
How can the registration of an event handler be deactivated?
Using the ACTIVTION ‘ ‘
For example SET HANDLER lcl->on_hotspot for For all instances activation = ‘ ‘
Event handlers can only have the same visibility of the events they are handling?
False. They can be the same or more restrictive. For example a public event can be handled in a privavte handler, but a private event can not be handled in a public handler
Can a class be defined as an interface component?
No
Can a handler be set within the instance constructor?
According to the demo, it is not necessary to have a separate handler class. The handler method can be defined in the instance as a method and set in the constructor