Monday, May 07, 2007

Google Web Toolkit, Spring and Hibernate

Following on from the previous post, I've been trying to create some new GWT apps using that latest integration libraries, widgets and so on.

Previously there were some issues with trying to get GWT and Hibernate to play nice (Hibernate required Serializable, lazy-loading caused havoc, and there was manual work to map your objects), but a new library has been developed to semi-transparently map between Hibernate objects (complete with lazy-loading, etc) and objects capable of being serialized over the wire to GWT client apps. The only piece missing from here is a Spring interceptor to wrap around the service which would be able to transparently do this - I may have a crack at that myself.

So the list of libraries for my current GWT applications is:
  • Spring - General application framework providing IoC, DI, AOP, and many other services for both general and web applications
  • Hibernate - Generic ORM solution. Probably the best of the current crop - integrates as an EJB3 persistance provider as well.
  • Google Web Toolkit - Browser client-side application development framework, including AJAX functionality
  • Rocket-GWT - Lots of client-side GWT widgets here
  • gwt-widget-server - Provides easy integration between Spring and GWT for the service layer functions
  • Hiberate4GWT - Provides easy integration between your GWT POJOs and Hibernate POJOs
That about closes it off for the moment.

Sunday, April 29, 2007

Another year, another post

Oops! Almost a year has gone by - I think my desire to join the blogosphere wasn't as strong as I thought :). No matter ... time to report on further developments I guess.

GWT is now up to version 1.3.3, with a 1.4RC just around the corner, and has picked up quite a following. There are now a number of working applications, and more importantly websites, blogs and other sources if information on GWT. Some of the more popular ones for me are:

  • gwtPowered - a list of various different frameworks and other useful stuff
  • rocket-gwt - a great component framework with lots of great UI widgets and functionality, like context menus, sliders, and replacements for some of the standard components.
  • gwt-widget - another component site, but of particular interest is the GWT Server Library which allows standard Spring objects to be exposed as GWT services, without needing to explicitly tie that code in with the RemoteServiceServlet. This works by weaving code in dynamically using cglib's dynamic proxies.
  • jwc-gwt-components - my GWT framework :) - this was written a while back and combines some of the features of the above toolkits. It's unique feature is that it provides widgets to integrate the TinyMCE and FCKEditor DHTML editors into GWT applications.
Personally, I think that the rocket UI implementations are probably better than the JWC or gwt-widget ones in most cases, while the gwt-widget server library method of weaving Spring components in is much cleaner than my copy-and-paste job of the code from the RemoteServiceServlet.

I still believe that it's silly to try and write a native GWT editor, especially as there are many decent editors out there that people already know how to use. Of course, they might give too much functionality, and can't necessarily be controlled as well from with GWT code.

Perhaps a refactor of JWC to focus the the GWT part of the project onto just the TinyMCE and FCKEditor support isn't such a bad idea, since most of the other parts of the framework are sown up elsewhere. Watch this space! - hopefully for less than another year!