ULC's event model is based on the same principles as the standard Java (AWT and Swing) event model. However, since ULC aims at minimizing network traffic, it is less comprehensive and complex. The ULC application framework does not give access to low-level events (e.g., mouse events). Instead, low-level events are either handled locally on the client side (to avoid a server roundtrip) or converted to a semantic event (e.g., action events), and then sent to the application. The implementation of the event model for ULC components is based on the concept of optional events, i.e., events are sent from the client to the server only if there is at least one registered event listener for this event on the server side. Client-side state changes alone do not trigger client-server communication. Only events that need to be passed to the server side can produce a server roundtrip; as part of this roundtrip all pending data updates are also passed to the server side and handled before the server-side listeners are called. Events hence define the communication behavior of a ULC application. In addition to these component events, the ULC framework comprises events that can be issued by application models such as table models.
Component Events
The UlcEvent class (extending java.util.EventObject) is the superclass for all ULC
events that are triggered by client half objects and passed to the server side. All
event classes provide access to the source of the event, i.e., the component that fired this event. For all events,
there is a corresponding listener interface that must be implemented by classes that wish to be notified about such
events.
Due to the distributed nature of ULC applications, event delivery may take a
considerable amount of time. ULC keeps the user interface as responsive as possible, e.g.,
dynamic loading of data does not block the user interface. For events, however, the user
interface must be blocked to ensure state consistency on client and server. To further
improve the usability of a user interface, the application developer can configure ULC
widgets to deliver certain events in an asynchronous way. With such a configuration,
users are able to continue to interact with the user interface while the event is being
delivered to the application. Appropriate usage of this feature can drastically improve
the usability. However, the application developer must ensure consistency by
application-specific means.
Model Events
ULC model events are events that signal changes in application data models
(e.g., table models). Such events are constrained to the server side.
All event classes extend java.util.EventObject and provide access to
the source of the event, i.e., the component that fired this event.
For all events, there is a corresponding listener interface that must
be implemented by the classes that wish to handle such events.
Model based components (e.g., ULCTable) use model events that originate from
application models to update their view on the client side. Although this is the
most important use case, applications can also register model listener themselves.