Since approximately one year i am coding with gwt and MVP pattern (also using "Activity" and "Places") . The VP-Part was never a big Problem. But i often stumbled over getting a "model" for current place or generally how to get from Place to Model->Activity->View.
My main problem is that on start of an activity the model is mapped into a String (token of a place) and must be "resolved" to data objects (i.e. userId to userObject) . i think that is the main difference between "classic" MVP using an EventBus or other means to communicate state changes (via "real" objects) and A&P-based MVP that knows only two states: the current place.getWhere() and the next goTo(new Place) - each mapped to/from String mapped.
So whats the point: So far i tried many approaches to "resolve" the state, but all feels wrong:
The simplest is to let the activity resolve the state by calling the needed async-services (to get an user for an userId). But as soon as two activity share the same place/model this code must be copied - bad. The other stuff i tried was even worse - my last
attempt (also asked
here) didn't work.
My question is: What is best/good practice to implement such a state resolver classes? Are there any examples (Place->Model->Place)?