Question

What is your favorite GWT MVP Framework, and the reason behind your choice?

  1. Mvp4g
  2. GWTP
  3. GWT 2.1 Built in
  4. gwt-mpv
  5. gwt-pectin
  6. guit
  7. Other platform (please provide link)
  8. Own solution (with boilerplate code?)
  9. None

Thanks.

Updated: Added suggestions 3, 4, 5 to the list.

Updated 2: Added guit to the list.

Was it helpful?

Solution

I think the best technique of MVP for GWT is to have the following classes

  1. Model
  2. View
  3. Presenter

And make the view and the presenter interacts through a defined interface and have the presenter fetch data from the model. First, it is very simple, secondly it allows team working since we are using interfaces, every teams just have to abide by the interface.

For e.g.

     1. Those working on the MODEL abide by the ServiceAync Interface

     2. Those working on the view creates the User Interface and returns the  
        specified control to the presenter according the program interface defined by
        their respective presenter
     3. And Finally those working on the presenter level defines an interface which
        the view has to implement

I think that the main problem that can arise in this is when one part which may be one of the View,the Model or the Presenter doesn't abide by the interface

OTHER TIPS

This is a bit of a difficult one at the moment. It seems MVP is the flavour of the month (or year, as it were) but there are so many options available and very few actual tutorials.

I went through the Contacts example and kinda got it: http://code.google.com/webtoolkit/articles/mvp-architecture.html

Then I realised they had added Activities and Places in 2.1, so I looked at that example: http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html

There are also numerous frameworks out there but most people seem to want to use "the google way" if possible. I'm going to give http://code.google.com/p/gwt-platform/ a go because it looks like it has some great docs, and that'[s what google is lacking at the moment.

The point is, there are no good TUTORIALS available - that's how we will all actually understand. The Stockwatcher tutorial on gwt was really useful, we could do with more like it. Here's some tidbits I've found:

I use GWTP because it is reasonably well documented, easy to understand and has an active user community. When I started learning the framework I had to ask a couple of questions in the forums and on both occasions, I got a friendly and helpful response on the same day from one of the authors.

The new version of GWT (GWT 2.1) introduced an MVP framework,

they introduced some new terminology like:

  1. Views
  2. ClientFactory
  3. Activities
  4. Places
  5. PlaceHistoryMapper
  6. ActivityMapper

you can check the details here:

http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html

Seems see GWT frameworks are a dime a dozen, much like Java web frameworks. That being said, I went with 4. Primarily because I wanted to do MVP without the boilerplate interfaces:

http://www.gwtmpv.org/viewgeneration.html

Docs are light, as always, but ping me if you have any questions, I'd be glad to answer them.

gwt-pectin is good too--I think gwtmpv is more succinct, but gwt-pectin has been doing the rich model/bound to a view approach for awhile.

Also using the built-in MVP framework, luckily when using Spring Roo GWT, all that boilerplate code is generated for you.

For me its GWTP, a complete model-view-presenter framework to simplify your next GWT project. available at http://code.google.com/p/gwt-platform/

I tried GWTP but it doesn't everything under the hood without you understanding it and it is hard to diverge from there way of doing things. I had this issue the first time I tried it and I tried it again too. Unfortunately, I had the same issue. I wanted to combine the Presenter and View for 1 page because it was overkill for that page. Unfortunately, I couldn't figure out how to do that so I decided that my worst fears had been realized. It's very hard to diverge from their way of doing things in GWTP. The architecture of GWT 2.1 is much more decoupled. I hadan issue with the ActivityMapper though. Now I'm looking at mvp4g.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top