Java - Advantage of the event-delegation model over event inheritance model.

What is the advantage of the event-delegation model over the earlier event inheritance model?

Event-delegation model has two advantages over event-inheritance model.

- It enables event handling by handling the objects other than ones which were generated by the events or their containers. It clearly separates component design and its usage.

- It performs much better in applications where more events are generated. It is because of the facts that, this model need not process unhandled events repeatedly, which is the case in event-inheritance model.

- Event-delegation model allows a separation between a component's design and its use as it enables event handling to be handled by objects other than the ones that generate the events.

- As event-delegation model does not have to repeatedly process unhandled events, it performs much better in applications where many events are generated. This is unlike the event inheritance model.
What is the purpose of the wait(), notify(), and notifyAll() methods?
The wait() method makes the thread to halt, thus allowing other thread to perform...
Event-listener interface and an event-adapter class
An event-listener interface allows describing the methods which must be implemented...
What is the purpose of the enableEvents() method?
To enable a particular event of an object, the enableEvents() method is utilized...
Post your comment