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
2 comments:
I think you may have misinterpreted Hibernate4GWT ... it does not support lazy loading, all uninitialized proxies are simply nulled out when passed to the client and then replaced with the original proxy when the object is serialized back on the server. This approach basically requires that you preload your lazy associations before using them on the client side.
Mark - I understand what you mean - perhaps I should have been clearer in the original post. What I mean by "support" is that the proxies are null'ed out, so that you don't end up loading all the lazy items as a result of naively iterating through the collections. In this way, you can indeed preload the associations you want, but only those you want for that request.
Post a Comment