vendredi 23 septembre 2011

GWT 2.4 et après

Avec la version 2.4 de GWT, pas de bouleversements majeurs. Par contre, on constate l'intégration de GWT avec d'autres produits de Google et notamment Android. Pour le moment l'intégration avec Android se borne à la communication au niveau des services rpc, mais il y a fort à parier qu'il s'agit d'une première étape.
Cette version montre que GWT s'ancre un peu plus encore chez Google, sans faire de bruit.

Aujourd'hui en lisant le résumé des contributions sur GWT, je me suis aperçu que GWT allait se doter d'un moyen de debugger le code final (javascript natif).
Jusqu'ici il fallait demander au compilateur de ne pas offusquer le code javascript en sortie pour pouvoir débugger le code final.
Ce problème est le même avec d'autre toolkit comme "Minification", "CoffeeScript" ou "Google Traceur".
Les prochaines versions de GWT vont donc supporter SourceMap, qui est une initiative de Mozilla. Rapidement, je cite :

SoureMap is for all generated code, it keeps a map from input source locations to generated source locations. It uses that map to report errors using the input line numbers and to link to the input source from the console. Support for working with a debugger in the input language will come later (see “Next Steps & Open Issues”).

A noter que Webkit va aussi implémenter SourceMap. Ce qui signifie que l'approche de GWT et consorts pour écrire des applications web est de plus en plus soutenu par les ténors du web. Une bonne nouvelle pour la productivité et la robustesse des applications web.

dimanche 5 juin 2011

Standby but not dead ;-)

As you can see this blog is not very active lately.
This is not due to disinterest, but because of time. I currently work overflowing. And i have a hobby (after computer science), which I neglected too much lately : fishing
So the activity of this blog will slow down...
Nevertheless, this blog is not dead. I continue to follow closely the technological developments and especially the Google technologies.
I would return as soon as you can about the latest GWT from Forplay of GWTQuery of SpringSecurity with GWT-RPC ...

Stay Turned ;-)

mercredi 13 avril 2011

Elegant way of using REST services with GWT

With GWT it is very easy to call remote services asynchronously. To do this, simply use the GWT RPC mechanism.
However, this solution is not ideal, not in terms of design, but in terms of standard.
Indeed, the RPC mechanism is based on a proprietary data serialization. Even if the serialization format is open, it still proprietary and therefore not interoperable.
In contrast, REST is totally interoperable, but can put off when you are accustomed to the easy call to RPC services.
Well there is an API that brings together the best of both worlds. This little gem is called : restygwt.

At server-side, services are created with the implementation of your choice (for me jersey) : standard.
And at client-side interface, which contains the methods exposed by the REST service. This interface must inherit from the interface and use annotations RestService rest @ Path, @ POST, @ GET, @ PathParam ...

The interface methods should return void and take an extra parameter to handle the callback (MethodCallback ).

Then, simply instantiate the proxy for a rest service call as an RPC service with GWT.create (MyService.class).
The call is done the same way as an RPC service.

Here we see that the call to service rest is greatly simplified thanks to the powerful mechanism deffed binding.

Enjoy.