Tag Archives: GWT

My top 5 Examples of Learning Google’s GWT + MVP + GIN + UIbinder

After a long week of studying the Google Widget Toolkit, also known as GWT I needed more specific examples on how to use The MVP + UIbinder and also using GIN with it. For those on the same quest, I’ve made a summary of the examples I’ve found on the web that have been most useful to me.

First some little summary for those really just starting out with GWT + MVP & GIN.

Model-view-presenter (MVP) architecture works best when developing GWT apps for two main reasons. First the MVP model, much like other design patterns, decouples development in a way that allows multiple developers to work simultaneously. Secondly, this model allows us to minimize our use of GWTTestCase, which relies on the presence of a browser, and, for the bulk of our code, write lightweight (and fast) JRE tests (which don’t require a browser).

The examples on the website from Google are sufficient to understand the material:

However after that we need some working examples to get our hands dirty.
The best example is in the example directory of he GWT SDK and is called HelloMVP. Since this software is constantly updated I leave it to the reader to download it from google.

The best way to explain GIN is by a quote from Anh Quan Nguyen:
“GIN Stands for GWT INjection. Guice brings automatic dependency injection to server side code, while GIN is for client side code.
GIN is built on top of Guice and uses a subset Guice’s binding language.”

We use GIN to reduce code and facilitate testing. That sounds like a good habit, but has some learning curve at the beginning that can be quite frustrating.

A great tutorial to start with is the presentation of Anh Quan Nguyen 

I found a couple of very useful examples which cover GWT + GIN + MVP + UI + EventBus
  1. One of the most straight forward example I’ve found refracted the standard HelloMVP application and transformed it into a full GIN version was written by Etienne aka The Wandering Canadian and can be found here: http://wanderingcanadian.posterous.com/hello-mvp-with-gin   
    Also check out his SVN repository for the full working example: https://github.com/etiennep/Wandering-Canadian

  2. Another example using GWT + MVP + GIN was written by Mahamad El Tanahy  http://www.bright-creations.com/blog/gwt-2-1-mvp-gin-example/ Different approach but good learning material

  3. A great example of how to use the EventBus was written by Hamlet D’Arcy which explains in great simplicity the use of the event bus GWT EventBus Basics

  4. The Guys from CANOO transformed the example of Hamlet into a working GEN version!: http://www.canoo.com/blog/2011/06/20/gwt-dependency-injection-recipes-using-gin-iii/

  5. Than finaly a great tuturial was written by XXXXX about how to integrate the RequestFactory into the GIN structure:
    http://cleancodematters.wordpress.com/2011/05/19/gwt-requestfactory_with_gin/
My challenge now is how to integrate the com.google.gwt.editor.client.Editor; 
into these frameworks. And any help is highly appreciated 🙂 .

Wessel
“Success is not the key to happiness. Happiness is the key to success. If you love what you are doing, you will be successful”