JAVA Event Handling Mechanism The Delegation Event Model

The modern approach that java uses to handle events is based on Delegation Event Model , which defines standard and consistent mechanisms to generate and process events.

It’s concept is simple : a source generates an event and sends it to one or more listeners. A listener simply waits till it receives an event. Once an event is received it is processed by a listener and then it returns. The advantage of this scheme is that the application logic that processes the events and the user interface logic that generates that event are purely separated by two different pieces of code.

The delegation event model eliminates the overhead of wastage of CPU cycles as compared to the JAVA’s original approach JAVA 1.0 for handling Events.

4 comments

Leave a reply to Rohan Cancel reply