GWT 2.2 MVP vs. GWT 2.1 Activities-Places
Asked Answered
L

2

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 :-)

Labanna answered 17/3, 2011 at 16:30 Comment(2)
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.Huh
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.Secern
A
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/

Aerobiosis answered 18/3, 2011 at 16:42 Comment(1)
Ultimately, I decided to use GWTP. So far, I'm very happy I did.Labanna
A
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.

Anta answered 17/3, 2011 at 16:42 Comment(2)
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...Labanna
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.Anta

© 2022 - 2024 — McMap. All rights reserved.