11

I'm starting to develop a large GWT application, and after reading a lot of articles and blog posts, I'm trying to understand what is the difference between the 2.2 Model-View-Presenter and the 2.1 Activities-Places design patterns? Which pattern do you recommend and why? Should I use MVP simply because it is "newer"? On the other hand Places-Activities seems to be more "intuitive"... Or am i totally missing the point and MVP is just an improved version of Activities-Places?

Thanks to all GWT gurus out there :-)

Tom Teman
  • 1,975
  • 3
  • 28
  • 43
  • 9
    Actually, activities and places, contrary to how they're advertized in the docs, are **not** about MVP. They're not a design pattern, they're a framework for in-app *navigation* (*where* to go? *what* should I do *there*?). You can use activities without the MVP design pattern, and you can use MVP without activities or places. – Thomas Broyer Mar 21 '11 at 23:38
  • Yes. I worked on an app that put the presenter as an interface in the view, but all the business logic was in the Activity. We called a composite widget from the viewImpl by the Activity. The presenter was used a through way, so to speak, to get back to the activity from a stand alone composite widget. – James Drinkard Nov 16 '11 at 14:02

2 Answers2

9

First I would recommend you reading this: http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html

MVP - is a design pattern which will help you separate logic from your UI to make it easier to Unit test. It's pretty much derived from the MVC pattern.

Activities - a concept in GWT analogous to the MVP pattern.

I think activities are a bit more intuitive than View-Presenters but not that much. You could look at this framework to assist you in using the MVP pattern (I greatly recommend it):

http://code.google.com/p/gwt-platform/

code-gijoe
  • 6,949
  • 14
  • 67
  • 103
1

Places Activities is a framework provided by gwt for the MVP architecture. MVP is the concept, and one of the ways to do it is the places-activities framework. You should definitely try their new places- activities framework.

Before 2.1 (need to confirm), gwt just gave the architecture. you had to develop the framework.

Behrang
  • 46,888
  • 25
  • 118
  • 160
Jai
  • 3,549
  • 3
  • 23
  • 31
  • oh. So I must admit it's kinda of confusing that they didn't use the Activities-Places pattern in the newer 2.2 version... – Tom Teman Mar 17 '11 at 16:46
  • 2
    waaait! 2.2 has it... they just havent updated the docs from when they introduced Activities places in 2.1!! The article you are refering for MVP, isnt 2.2 specific. Its to give you a broad understanding of the MVP architecture. – Jai Mar 17 '11 at 17:10