Rapide -> Advanced UI -> Listeners

Listeners are used to synchronise common data between multiple windows, allowing dynamic applications where the displayed data is always up to date.

Sophisticated user interfaces that display the same data in multiple windows often need to have a mechanism to refresh the common data when it changes. In the past this has been difficult to achieve with Gen and therefore the developer either ignores the requirement or has to use complex logic to implement the refresh capability.

With Rapide, the developer can register a Listener on a specific object or multiple objects using wild cards or multiple Listeners. The Listener can then trigger an event when the object changes, thus enabling synchronisation of common data between multiple views of the same object.

For example, an order processing application contains multiple windows that display purchase order details.

  • Each window that displays purchase order details registers its interest with the listener using an action diagram function

  • When the purchase order details change, the developer uses an action diagram function to notify the listener that the object has changed

  • The listener automatically posts update events to the interested windows which can then retrieve the details they require and update their display

Rapide Listeners support either session-specific messaging or global (across multiple JVMs in a load-balancing architecture for example) through the use of a central Listener service called the Rapide Global Listener (RGL), which is available as a separate add-on for Rapide.