Monday, February 15, 2010

Simple Java Event Bus

I've just released some code that has come in handy for quite a few projects I've worked on. It's called the Simple Java Event Bus and is released under the New BSD license. You can download the code here: http://code.google.com/p/simpleeventbus/

An event bus is a useful pattern for decoupling the components of a highly meshed application. Event bus is a substitute for the Observer pattern, useful when too many observers/observables exist to keep a clean design. Components can couple directly to the EventBus instead of to each other, allowing events or messages to be published to the bus. Listeners to the bus will then be notified about the event if they have interest in the event type.

I have used other event bus implementations in live code. However, I have found that the above library to be the most simple to use and to get started quickly with. Hope you can benefit from the code as well.

No comments:

Post a Comment