I understand that Places & Activities are separate from MVP. P&A are for managing browser history, and MVP is an architectural pattern. But, obviously, they interleave and overlap in areas, and this question is about how they can work cohesively together, in unity.
I just read up on GWT Places & Activites, and recommended MVP structure, and my head is spinning. I need someone to confirm I have the basic idea down.
A PlaceHistoryHandler
has both a PlaceController
and PlaceHistoryMapper
. When you enter a specific URL in a browser address bar, the PlaceHistoryHandler
uses its PlaceHistoryMapper
to determine which Place
it should pass to its PlaceController
. The PlaceController
, in turn, fires an appropriate PlaceChangeEvent
onto the EventBus
.
One or more ActivityManager
s are listening on the bus for such PlaceChangeEvent
s, and map those Place
s to an Activity
, which is supposed to be the Presenter component in an MVP architecture.
The returned, concrete Activity
(presenter) should have a model-injected view (typically UiBinder) that implements AcceptsOneWidget
. This AcceptsOneWidget
component is then started (via Activity#start(...)
) and GWT - automagically - presents its contents to the browser.
Is anything I've said incorrect, misleading or misunderstood? If so, please correct me. A lot of code is about to be written based on this understanding...
Maybe this can help you a little bit
I used this schema when I was getting confused :