Restlet edition for Google Web Toolkit
Introduction
This chapter presents the Restlet edition for GWT, which is a client-side port of the Restlet Framework to GWT 1.7 and above releases. See this blog post for the official announce.
Description
Google Web Toolkit is a powerful and widely used platform for rich internet application. It is based on a smart compiler taking Java source and producing optimized JavaScript (byte)code.
By default, GWT recommends using a custom GWT-RPC mechanism to communicate between the GWT front-end (Web browser) and the back-end (Web server). In addition, the back-end has to be built using a Servlet container in order to work properly and to invoke your custom classes and methods. This might remind you of the RMI (Remote Method Invocation) or CORBA mechanisms and it comes with the same issues: the tight coupling between client and server code. Also, this reduces the opportunities of integration with other back-end technologies, outside Java/Servlet.
As you know, REST is a much more flexible and interoperable way to communicate between a client and a server. On the server-side, you can use Restlet or alternative technologies. But on the GWT front-end, the support has been limited so far. The GWT API does contain classes to send HTTP requests but they are quite low-level (you need to understand the HTTP headers syntax for example) and slow down productivity.
Thanks to the GWT 1.5 release, it became possible to quickly port the Restlet API and Engine to GWT. We kept only the classes required for the client-side obviously and had to remove classes based on Java APIs not available in GWT (such as NIO channels or BIO streams).
Finally, Restlet 2.0 added support for annotated Restlet interfaces and automatic bean serialization into its GWT edition, in a way that is consistent with other editions. See this first system example.


There are no comments.