1

I am working on this project which uses 100% gxt code. Now we have another small project which is written using GWT MVP pattern and we are tasked to integrate the 2 projects into one.So pretty much we will be making back and forth method calls between gxt and mvp code(with activities and places). I am a newbie in using mvp pattern and kind of confused if its really good idea to combine the two.The other(small) project used to be gxt as well until it was rewritten using mvp pattern. So I have the option to either go back to old gxt code or integrate the new mvp pattern into the main gxt app.But since gxt doesn't support activity/places concept its not straight forward to call mvp code from gxt.You need to pass in fake data to simulate places etc. when calling mvp code. In addition there are issues in mvp code when going from one place to another, such as when there is time delay during the rpc call to server side, the screen becomes grey in color(since the current view is retired and the new one hasn't initialized yet) waiting for the rpc to return before navigating to next place.

So I would really appreciate any opinions from experts in MVP area on how address this situation...

yonikawa
  • 581
  • 1
  • 9
  • 32
  • Which version of GXT are you using? GXT 3 offers support for newer GWT features (e.g., places & activities, RequestFactory, UiBinder, etc.). Also, please note that GWT Activities and Places is not an MVP architecture, although it can be used in an MVP application. – Andy King Apr 02 '13 at 22:00

1 Answers1

0

In the presenter I stick anything to do with data manipulation and testable code, or whatever makes the view dumb. That said I like to make the presenter control the view, but there are many grey areas in which I say do what works and iterate. The best way to boil it down is build a JUnit test and and test the presenter logic, at least this is what we do with GWTP.

A&P doesn't really have a set way for building strict MVP or maybe if building a MVP approach in A&P could be done differently. But I might stick the data manipulation logic in the Place or Activity.

I have the Request Factory available here, which would allow for the data source. https://github.com/branflake2267/Archetypes/blob/master/archetypes/gwt-activitiesandplaces-requestfactory/src/main/java/org/gonevertical/project/client/application/home/HomePlace.java#L16

In my latest project where I'm using GXT, I'm using GWTP for the MVP framework which works great for following a strict testable MVP pattern.

I've got the GXT data objects inside the presenter. This project is young, so I'm still fussing with the placement of stuff. But I think it may give an angle of GXT object placements at least in this presenter. https://github.com/branflake2267/Project-Manager/blob/master/Directory/src/org/gonevertical/pm/directory/client/application/widgets/archetype/list/ArchetypeListPresenter.java

Brandon
  • 2,034
  • 20
  • 25