1
votes

Going over the GWT Activities and Places tutorial (here: http://www.gwtproject.org/doc/latest/DevGuideMvpActivitiesAndPlaces.html), a SimplePanel is constructed in onModuleLoad() in the EntryPoint class and then added to the RootPanel. Doesn't this break the MVP pattern or does the EntryPoint technically fall within the view portion of Model-View-Presenter ?

Also, on a related note. I'm not quite clear on what passing the panel to setDisplay() on ActivityManager does. The documentation says "Sets the display for the receiver, and has the side effect of starting or stopping its monitoring the event bus for place change events.". I can't visualize what that means, and looking at setDisplay(), I still can't visualize what they mean.

2

2 Answers

2
votes

Activities & Places is not about MVP, it's about navigation within the application, and organization of your code and decoupling. See http://blog.ltgt.net/gwt-21-activities/
If you want to do MVP in your EntryPoint, you're free to do it; just retrieve your panel (as an IsWidget) out of your view to pass it to your ActivityManager.

As to setDisplay, it sets the IsWidget that your activities will receive in their start() method.

1
votes

No it doesn't break the MVP pattern, because it doesn't try to apply the MVP pattern at this point.

Activities / Places help you to structure your code at the application level, handle navigation and history. And inside an activity you apply the MVP pattern, often (but it's not mandatory) Activity = Presenter. Roughly One Activity = One MVP. So MVP help you to structure and reuse your code but at a Activity level.

For your other question I didn't find your quote. In which section is it ?