As a background, consider the following situation: There is a UsersPresenter responsible for presenting all Users. It has a link for AddUserPresenter, responsible for adding a new user. Whenever the UsersPresenter calls the AddUserPresenter, it wish to execute some logic when the AddUserPresenter is done (for instance, get all users from the server or get this recently created user and add to the users grid).
As you can see, we have some points to consider.
1) A Presenter has a purpose. Having a purpose, it should have some method that would finish its cycle.
2) A Presenter can return a result and some data.
These exposed situation and considerations reminds us the Activity concept used in Android.
If you're not familiar with Android, please consider reading this article (link), which will briefly explain the Result mechanism into Activities. Also see this post for understanding how an Activity finishes passing a result.
If you find these ideas reasonable, I propose two alternative solutions for promoting this new Presenter communication feature.
1) Use the same solution adopted by Android.
Basically we could apply this "Activity design pattern" into GWTP Presenters. So every Presenter would have a method called "onResult(...)" and another called "finish()". Additionaly, the reveal process would have an additional "revealWithResult(...)" mechanism. Finally, GWTP could add a new component similar to the "Bundle" used in Android for transporting data.
2) Use a more appropriated solution for the GWT nature.
Instead of implementing this bunch of changes and make GWTP similar to Android, we could just add two new methods to the Presenter and fill this need. Presenter would have a protected no-argument "finish()" method informing that the Presenter finished its cycle. Additionally, the Presenter would allow a public registration of a disposable callback. Whenever the finish method is called inside the Presenter, it executes the registered callback. After the callback execution, it is deregistered from the Presenter. For starting this cycle, one Presenter would reveal another passing a callback as an argument. This callback can expose the target Presenter, so the revealing one can access its properties and retrieve desired data.
this second solution is fully backwards compatible, it would require few changes and they would only be additions.
Note that this exposed situation could not be satisfactorily resolved using only Presenter's lifecycle methods. (Android Activities also have lifecycle methods, but they are not used with this intent).
So, that's my main suggestion for the 2.0 roadmap. I'm here for further clarification.
--
D. Reinert