Where best place to register event handlers when using MVP paradigm? I know that application wide events must be registered in "AppController", but I need to rise event from one presenter, and second presenter must handle it . So is better to define eventHandler inside AppController, or better to define eventHander inside second presenter (rise this event in 1st presenter)?
1 Answers
1
votes
Application wide events don't necessarily have to be registered in the AppControler.
I don't think it actually actually where you register them as long as you pass around and use one global singleton EventBus.
Normally you pass this global EventBus to your various Presenters via a constructor parameter (using dependency injection for example).
In the first presenter you can register for a specific event which is fired by the second presenter on the global EventBus.