Google Web Toolkit

  • In late February, I gave a presentation to a local Java Users Group on GWT.
  • The first half of the presentation was basic and introductory in nature. Topics here included GWT RPC, the event bus, MVP, UiBinder, Eclipse, Maven, GWT Incubator, Smart GWT, and GXT.
  • The remaining half talked about integrating GWT projects with other technologies that you would expect to find in any modern, enterprise grade web application. These include templating systems, IoC/DI, Security/Authentication, Cloud Computing, and intelligent search.
  • Here is the slide deck to that presentation. Feel free to post any questions that you may have about this topic below as a comment and I shall answer them.
  • Traffic to this page indicates to me that there is quite a bit of interest in GWT. Here are some extra resources for those wishing to learn GWT. Take a look at GWT in Practice by Robert Cooper and Charlie Collins and Pro Web 2.0 Application Development with GWT by Jeff Dwyer.
  • There seems to be a lot of interest in using an ORM with GWT. In general, ORMs such as JDO and JPA are incompatible with GWT-RPC. DTO is the best practice approach to solving this incompatability problem. There is a lot of push back from the development community over DTO because of all the extra coding involved. One way to reduce some of that coding is to use a general purpose object assembler to do the transfers. Here are some open source projects to help you along with that.
  • My original presentation mentioned both GeDA and simple-object-assembler. GeDA doesn't require an XML configuration file. Instead, it depends on annotations. This is a pretty small project lacking on documentation so be sure to check out this quick start page. The simple-object-assembler doesn't require any XML configuration or annotations. It does require that property name match or you have to code a custom converter which sort of defeats the purpose.
  • Since then, I have also learned about Gilead and Dozer. I mention hibernate4gwt in the presentation. This project has been renamed Gilead. In theory, it is now supposed to be more general purpose than hibernate but in practice hibernate is still the only ORM currently supported. Dozer tries to map based on matching property names with some rudimentary type conversion if necessary but you can also provide an XML configuration if the names don't match completely.

 

Comments

What is the meaning of POSH?

Greetings,I've found the term POSH in your slide.What is the meaning of POSH?Plain Old Semantic HTML or something else?ThanksHommeDeJava

POSH Means Not AJAX

You got it. POSH means Plain Ole Semantic HTML. In other words, the content comes with the markup when the page loads and not through subsequent AJAX calls. Typically, people associate GWT with AJAX but there is no reason why you can't blend the two (AJAX and POSH) into the same project.

GWT is Not Another GUI Template System

I got an email from someone asking about MVP. The sender mentioned the need for a multi-page web app written in GWT and using MVP.In the days of POSH, there was a different HTML (or JSP or PHP or ASPX, etc) file for each page. GWT is more about RIA where what is perceived as a page by the end user doesn't really load new HTML necessarily. The sender sent some screenshots. I wouldn't bother to create new GWT modules based on those screenshots. That's what they are called in GWT. When you want to create a new page that is really going to end up being a new URL, then you add another module to your GWT. I talk about this from slide 18. Maybe you want these to be individual pages because you want each message to be URL addressable? You can still do that in a single module app. You just need to tweak the web.xml file a little bit then add code to your app to parse the request URL and to present the right data. The easiest way to do that would be to add a little JSNI to access the $wnd.location javascript object. Maybe you want the GWT app to do the right thing when the user clicks the browser back button? GWT has support for this built in. Take a look at the com.google.gwt.user.client.History class. There are also plenty of tutorials on this. Either way, it is imprudent to think of GWT as another templating GUI framework. What should prompt you to consider multiple modules is code complexity more than a user perception of page navigation. The concepts of MVP still apply whether you end up with one module or multiple modules.