Custom events in web front-ends
7 comments
Glad the article was useful. I should be able to post a very simple event bus example shortly.
As for casting doubt on your use of GWT - I think it depends on the demands and scale of the project. GWT is a great platform to develop in and definitely suits certain types of web app more than others. There's a lot about it I still really like.
Well, that was fast. A thousand thanks for putting together the example. I was able to checkout the code and get it running in Eclipse. Seeing this code in operation has really helped me get a handle on setting up an event bus in our application. The "event bus" concept should prove helpful for what we're developing.
Thanks,
-Tom
I plan to post a JavaScript version of the same pattern for comparison.
thanks again!!
Your post was really great, I have one question though, is there any concern with memory leaks?, I saw your code, and I may be wrong but once you add the handler (the widget) and then dispose it (for example, repainting the page placing new widgets) the handler object may be preserved in the event bus (singleton) in the page forever and ever........, Could you clarify me this?
Best and thanks
Thanks for a clearer example than the others I have seen. One thing I wonder about, though, is the registration of handlers. Unless I missed something, it seems that the registration is solely by event type, rather than by event source.
For many custom events, there might be only one source, but for events that could be generated by multiple components, aren't all of them flowing through the same entire set of handlers, so that each handler would need to look at the event source to see if it actually wants to process the event?


Thanks for the article. We are just getting our heads around implementing an event bus with GWT (despite the cloud of doubt you just brought over us with "GWT - it's not you, it's me"...). I would very much appreciate it if you could post an example of implementing an event bus using HandlerManager. I'm getting it... kind of... there are some ticklish points that will be sorted out by seeing a concrete example.
Thanks,
-Tom