Are event handler, event listener, and event registration all referring to the same thing?

ε祈祈猫儿з 提交于 2019-12-18 21:50:03

问题


If not, what is their difference?


回答1:


The listener is the object that receives notification, the handler is the method that actually handles the notification. Registration means to register a new listener to the event source.




回答2:


The Event Handler is the method that gets called to handle the Event.

The Event Listener is the mechanism that listens for the Event to happen. It then calls the Event Handlers.

Event Registration is the process by which an Event Handler gets registered with an Event Listener so that the handler is called when the Event Listener fires the event.




回答3:


Event handlers and event listeners both mean functions that respond to events.
In Java, an event listener is a (frequently anonymous) class which implements a Listener interface to handle an event)

Event registration is the process of registering handlers to handle events.



来源:https://stackoverflow.com/questions/5080204/are-event-handler-event-listener-and-event-registration-all-referring-to-the-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!