BT

Who needs GWT On Rails?

by Sebastien Auvray on Jan 09, 2008 |
Rails and GWT are both hiding Javascript manipulation from the Ajax development cycle. GWT chose to solve that by using a compiler which will convert Java into browser-compliant JavaScript and HTML. Jon Crosby made it possible to use GWT over Rails with GWT On Rails plugin.
GWT on Rails integrates GWT client side compiled JavaScript with Rails RESTful web services by providing client and resource generators, migration support, asynchronous RESTful client support, and Rake automation.
It's only a few steps: GWT Client generator, GWT model generator, and you'll have your GWT client ready.
GWT On Rails uses GWT-Rest to interface with JSON Request Rails plugin.

While Ajax integration into Rails is already neat, indirectly introducing Java into Rails is not a common pattern. Following this skepticism InfoQ got in touch with Jon to get his motivation for writing GWT on Rails plugin.

It's always nice to see new plugins extending a framework but doesn't GWT on Rails go against Rails philosophy by introducing unnecessarily Java weight in the development cycle?
Most of Java's weight comes from JEE, which is not part of GWT on Rails. Client side GWT uses the Java language to generate JavaScript; The heavy server side platform never makes it into the picture. In the past, using GWT may have been associated with Java on the server side too, but GWT on Rails breaks this connection. Of course, I'm not the first to do this. JanRain used GWT on the client and a Python/Rails mix on the server side to build Pibb.
I have found most architectural decisions are a set of trade-offs that can only be weighed in their specific context. For me, having fast, compiled JavaScript that gets even faster with each GWT release, in addition to avoiding most of the cross-browser debugging time sinks, was closer to the Rails "just works" philosophy than the alternatives I explored.

Do you know any serious architect who would use GWT On Rails? (Apart from a situation where he would have an existing GWT client ready and would like to switch to Rails).
In addition to a server side switch from Java to Rails, as you mentioned, there is also the case of the Rails developer wishing to build desktop-like interfaces with a good JavaScript toolkit. GWT on Rails builds on a high quality toolkit from Google and adds a Rails-friendly RESTful client, plus tools to keep client side JavaScript models in sync with ActiveRecord models on the server side.
For projects that are mostly forms-based with a little Ajax sprinkled in for effect, GWT on Rails may be overkill. For those wishing to push the boundaries of JavaScript-based web applications, I think GWT on Rails is worth consideration.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT