[DCOM-74] Ideas for Event Manager Improvements Created: 31/Oct/11  Updated: 21/Apr/14

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Johannes Schmitt Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I have two ideas for improving the event manager.

1. Add a lazy-loading implementation as we discussed on IRC already (helpful for keeping the overhead of post generation schema listener down for example)
2. Providing better debugging information of what is going on (which listeners have been called for which event, similar to Symfony2's event dispatcher)



 Comments   
Comment by Guilherme Blanco [ 16/Jan/12 ]

I'm still a huge fan of DOM2 Events.

I even have the code somewhere here, but that would break BC.

Comment by Marijn Huizendveld [ 06/Feb/13 ]

Would you care to elaborate on your DOM2 Events implementation Guilherme?

Comment by Guilherme Blanco [ 21/Apr/14 ]

Marijn Huizendveld sure (like... 1 year later!)
DOM2 Events ( http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/ )
The idea is to create an event system where you can control the flow over the listeners, such as prevent the default operation or stop propagation.
I'm a big fan of this because that way any piece can be easily decoupled from the base system and become a specialized event if needed. It also can be controlled depending on the conditions to be introspected by an specific listener.

Comment by Guilherme Blanco [ 21/Apr/14 ]

I also provided a very initial draft 2 years ago, as of https://github.com/doctrine/common/pull/153

Generated at Thu Apr 24 13:32:41 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.