Thursday, July 9, 2009

GWT and MVP (Model View Presenter) Pattern

After watching the google wave presentation at Google I/O, I changed my mind about the GWT (Google Web Toolkit) and I've been studying it hard. From the technical view, GWT is amazing and it's getting better on each new release. I was searching for best practices using GWT and I found this presentation: "GWT App Architecture Best Practices - Ray Ryan". Ray Ryan gives a lot of tips on how to create a well-structured and testable application using GWT. On the first thought I found it a little bit complex: when you deal with a simple screen it's easy to understand, but when you have to deal with a more complex screen, things get way more complex.

Ray Ryan presents the MVP (Passive View) pattern as a good solution, and it is. I spent many hours trying to figure out a way to implement the communication between the presenters. After this hard work I found - in my opinion - a good way to implement it, and I decided to share it with the world. I decided to share this knowledge as a sample application. You can find this application on http://gwt-mvp-sample.googlecode.com.

I'm not very experienced in this pattern so you might find some bugs or wrong concepts. The idea is to talk about it, to share knowledge. Feel free to change the source code, send me e-mails, add issues, etc.

I'm looking forward to your replies.