permaculture playing cards
The moose likes GWT and the fly likes Question about GWT MVP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "Question about GWT MVP" Watch "Question about GWT MVP" New topic

Question about GWT MVP

Mjeff Wilson

Joined: Oct 30, 2007
Posts: 4

GWT 2.0 introduced the concept of using the Model-View-Presenter (MVP) pattern to separate the business logic from the view, and gives some examples of how to do that here: However, it is left to the developer to implement this pattern along with a lot of boilerplate code. GWT 2.1 promises more support for this pattern; are we going to see an actual framework based on MVP in 2.1? What will this framework look like, and how will it help reduce the effort to write a GWT program using MVP?
Federico Kereki
Ranch Hand

Joined: Aug 27, 2010
Posts: 31
While I cannot (yet) give a definitive answer on GWT 2.1, I did go over MVP in my book. I took it down a notch --going for an event bus is overkill, unless you are bent on showing several views of the same data at the same time-- but implemented all the needed classes and methods, and went over debugging too. I included a little problem that usually isn't shown: suppose you develop a widget (in MVP fashion) for, say, picking a country and then picking a state for that country. (The detail, you have to go to the server to get the states.) How do you include that MVP widget in a MVP form? Where do you initialize it? How do you use it? How do you process its events?

While using frameworks is usually good, you generally find that you must work around (or against! ) it for some things you want to do, and thus I preferred developing my own code, so as to be able to show the inner workings of a MVP application. As soon as I learn more about GWT 2.1, I'll get down to using (and writing about) it.

Thanks for your question!

Great fan of Open Source, Linux, and web development with GWT; all of these come together for my ESSENTIAL GWT book!
I agree. Here's the link:
subject: Question about GWT MVP
jQuery in Action, 3rd edition