I've had a play with Google Web Toolkit now. Although I was impressed when I first found out about it, I'm a bit more skeptical now.
My test 'application' was a simple page with a single RPC call to a server function that just returned a random string. Not much, but enough to look at some of the features. I found that the server-side part of their RPC library included hooks to look at the serialized messages, so I tried it, and was surprised to see something that looked nothing like any common formats in use these days (XML, JSON, YAML...). It seems that while GWT provides a RPC mechanism, it's a proprietary and opaque one that means client code developed with the toolkit will not play nicely with existing applications.1
Next I decided to have a look at the generated JavaScript which was 'compiled' from my Java code. No surprises for guessing it was a horrible mess of obfuscated code, with functions starting at
It doesn't have to be that way. Rails has had 'RJS' for a while now, which relies on a base JavaScript library (Prototype) having a lot of more Ruby-like functions defined, so conversion is done at a much higher level. This results in simpler conversion, and generated JavaScript that is understandable because it is fairly similar to the original code.
1The toolkit does come with a sample using JSON, but since it has to fall back to a chunk of hand-written JavaScript, it seems to be missing the point.
My test 'application' was a simple page with a single RPC call to a server function that just returned a random string. Not much, but enough to look at some of the features. I found that the server-side part of their RPC library included hooks to look at the serialized messages, so I tried it, and was surprised to see something that looked nothing like any common formats in use these days (XML, JSON, YAML...). It seems that while GWT provides a RPC mechanism, it's a proprietary and opaque one that means client code developed with the toolkit will not play nicely with existing applications.1
Next I decided to have a look at the generated JavaScript which was 'compiled' from my Java code. No surprises for guessing it was a horrible mess of obfuscated code, with functions starting at
a(), b() etc. I'd say if your app doesn't work, there's little hope of doing much debugging at the JavaScript level. I don't really know what level the Java to JavaScript conversion works at, but all I can see from the generated JS is that there are Java classnames in literal strings in there, which scares me.It doesn't have to be that way. Rails has had 'RJS' for a while now, which relies on a base JavaScript library (Prototype) having a lot of more Ruby-like functions defined, so conversion is done at a much higher level. This results in simpler conversion, and generated JavaScript that is understandable because it is fairly similar to the original code.
1The toolkit does come with a sample using JSON, but since it has to fall back to a chunk of hand-written JavaScript, it seems to be missing the point.