Ok, I have to post a bit of a retraction. While EventDispatcher is still a big improvement over previous event models, it’s not quite as cool as I thought it was at 3am last night. Nothing ever looks quite as hot the morning after, does it?
The ability to subscribe functions or methods to events is made vastly less useful than I excitedly thought last night by the fact that the function will, of course, be executed within the scope of the object dispatching the event (duh). This means that really, this approach is only about as useful as a callback event handler (the functionality is virtually identical) – its occasionally handy for quick’n’dirty prototyping, but usually not good form.
Ahh… the murky clarity of 3am experimentation. Oh well, stay tuned, I hope to build out an extended version of the eventDispatcher that includes some nifty new tricks.