Welcome to EventDispatcher
EventDispatcher aides you in event-driven development. In event-driven developement you are using events (or often referred to as notifications) to build a flexible communication between different objects and components of oyur application.
Objects may register themselves or any kind of event-listener to a specific type of event (e.g. a successful login by a user). Other objects will then send a notification when any event occured and attach some additional information (the context of the event) to the notification.
So you could think of event-driven development as an advanced subject-observer-pattern.
The EventDispatcher class itself is the center of the event-driven application. You may register listeners for certain events and it also provides methods to trigger an event.
News
- 2006-03-29 : The unit tests of EventDispatcher now cover 96% of the source code
- 2006-03-01 : First public release of EventDispatcher
Download EventDispatcher
For more information on downloading EventDispatcher, please visit the download page.
Use cases
Event driven development can come in handy in a lot of situations. Here's just a short list that might give you a first impression, why you should incorporate this technique in your applications.
- Add logging to you application
- Add a custom black-list-check for authentication
- Act on relations between different components of your application (e.g. if user launched action A and then action B, execute additional code)
In all of these examples you will never have to touch the actual business logic, if you used a clever implementation of the event-driven-design.
Documentation
- DocsIntroduction -- Introduction to EventDispatcher
- DocsRealLife -- Real-life examples
- DocsGlobalListeners -- Using global event listeners
- DocsMultipleDispatchers -- Using more than one dispatcher
- DocsCancellingEvents -- Cancelling events
- DocsRemovingListeners -- Removing event listeners
- DocsAutoRemove -- Using the auto-remove feature
- DocsEventQueue -- Using the event-queue
- DocsCallbackListener -- Using the callback-listener
- Off-site documentation
- Component and event-driven arcitectures in PHP5, a presentation I gave the the International PHP Conference 2005 in Amsterdam
- PEAR::Event_Dispatcher, the PHP version of EventDispatcher, which I maintain together with Bertrand Mansion.
History
EventDispatcher is a port of the PHP-PEAR-package Event_Dispatcher, which was inspired by the NotificationCenter of Apple's Cocoa-Framework.
How to use this site?
This site is powered by Trac, which is an enhanced Wiki and issue-tracking system. You can use this site to report bug reports or feature requests and also browse the source in the subversion repository. If you need help with Trac, I recommend reading the TracGuide.
License
EventDispatcher is published under the LGPL.
Who uses EventDispatcher
EventDispatcher is currently only used by 1&1 Internet AG, as it has originally been developed as an add-on for their Pustefix framework. We decided, to publish it as open source as other companies may benefit from it as well.
