Pregunta

I'm trying to wrap my head around the general workings and principles of event dispatching in event-driven (sub-)systems.

Although I have used it on quite a few occasions in for instance Javascript, Flash (Actionscript 2 and 3) and have even made a simple event dispatching system in PHP for myself at one time, I've never really understood event bubbling and/or propagation that well.

First question:
Is event bubbling synonym to event propagation?

Second question:
Am I correct in my understanding that when an event "bubbles", this means that it gets "moved" up the hierarchy of objects?

Third and most important question:
If my understanding in question 2 is correct; how is this "moving" up the hierarchy of objects generally implemented?
Does it generally mean that the parent object "redispatches" the same event to its parent (until it reaches the root object)? And if so; do all these objects in the hierarchy need to listen to their children for these events, or am I missing something vital principle in my understanding about event bubbling, where there's no need to let parent object register them selfs as listeners of child object events?

If you could illustrate these basic principles by means of some simple pseudo code, I'd be more than grateful.

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
scroll top