问题
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 :-)
回答1:
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/
回答2:
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.
来源:https://stackoverflow.com/questions/5342132/gwt-2-2-mvp-vs-gwt-2-1-activities-places