An object may produce events of various types. The object needs to know who to tell about these events. Event are not yelled out into the world for any listener to hear. Events are not broadcast with megaphones. If module A wants to listen to events produced by module B, module A has to make a listener of some type and send this listener to module B. B has to be written in such a way that it allows listeners to listen to it. You can't just spy on module B because you feel like it. You have to ask module B to add your listener to its list of listeners, so module B has to implement some kind of addListener method.


Personal Tools