Search code examples
gwtevent-bus

EventBus role in GWT


I read up about this cool event handling in GWT using EventBus and so far I really like it. But I don't really grasp the concept when should I use it. All the time? Can I overuse it? Should I use it for everything event-related? (Like communicating between the view and presenter layer in MVP? Or can I use it with onMouseMove event? How heavyweight is it?)

So in one question: What exactly the role of EventBus in GWT?


Solution

  • I think using the global EventBus for the internal communication between a single widget's MVP parts is somewhat overusing. That would make your widget dependent on the eventbus. (If the eventbus wasn't in the core GWT that would be more obvoiusly unacceptable.) I consider the eventbus as being the communication medium between different widgets of different parts of the application.