Pages

Monday, September 19, 2011

MVP plus UiBinder example

Here you may read official google documentation for putting together MVP pattern promoted by Google for GWT development and UiBinder for xml declarative UI development for GWT. However, the example for download on this page is totally broken.

It took some time from me to fix bugs, do those features and refactorings in the source that were left undone. Here are changes to it that I made:
1. Eclipse configuration was added (.project, .classpath, .settings). GWT 2.4 and 2.4 Google
plugin were used.
2. Proper history support for editing contacts was added (ability to move back and forward
in browser to editing particular contacts, that is absent in both 1st and 2nd original examples
for MVP).
3. Black magic of native HTML for table was replaced with binded FlexTable for ContactsView
4. EditContactsView was implemented with UiBinder as well.
5. EventBus instead of non-recommended to this purpose HandlerManager was used (Such usage of HandlerManager was normal in the previous versions of GWT, but now is deprecated).
6. Code cleanup (several bugs were fixed, unused third domain object Address was removed, etc.)

You may found this fixed version of example on github.
If you are not familiar with git - just download zipped archive or a tarball - what is more appropriate for your OS and import it to Eclipse as an existing project.