InfoQ

News

Who needs GWT On Rails?

Posted by Sebastien Auvray on Jan 09, 2008

Community
Ruby
Topics
Ruby on Rails
Tags
Rails ,
AJAX ,
GWT
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.

No comments

Watch Thread Reply

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.