We read here and there, event handler, event listener... event handler/listener... object handler... it's a mass confusion that a newbie like me can't tolerate.
Anyone to clarify this question: What is the difference, if any, between event handler and event listener ?
Thanks a lot, MEM
Listener:
The intermediary, connecting object between a source of activity and a reaction to that activity.
A listener object's life cycle:
The term "listener" can be deceiving because, in most implementations, it is not actively doing anything-- it simply functions as a stored association between an event and an event handler.
Handler:
An object (usually a function) that provides a behavior to run when a subscribed-to event is published.
(See Wikipedia's "Observer Pattern")
(See Wikipedia's "Event Handler")
Important Differences:
A listener reacts to an event source, e.g. keyboard or mouse.
A handler reacts to an event, e.g. key press or mouse click.
The event listener is basically a delegate that listens to the event. The delegate is used to write a handler if the programmer need to do something on a particular event. So for a particular event, the listener works as a trigger to trigger the actual handler code.
You can read about this here:
http://msdn.microsoft.com/en-us/library/aa645739%28VS.71%29.aspx
and
http://blog.monstuff.com/archives/000040.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With