InfoQ

News

Who needs GWT On Rails?

Posted by Sebastien Auvray on Jan 09, 2008

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

QCon SF Keynote: Techie VC's Talk About Trends & Opportunities

Kevin Efrusy and Salil Deshpande talk about what makes a business successful or not, presenting three actual cases they have been involved with: Hyperic, G2One, SpringSource.

Project Lead Mark Fisher Discusses the Spring Integration Project

InfoQ talks to Mark Fisher, project lead for the Spring Integration project, about the framework.

How HTML5 Web Sockets Interact With Proxy Servers

Peter Lubbers explains in this article how HTML5 Web Sockets interact with proxy servers, and what proxy configuration or updates are needed for the Web Sockets traffic to go through.

Rails in the Large: How Agility Allows Us to Build One Of the World's Biggest Rails Apps

Neal Ford shows what ThoughtWorks learned from scaling Rails development: infrastructure, testing, messaging, optimization, performance.

Stuart Halloway on Clojure and Functional Programming

Stuart Halloway discusses Clojure and functional programing on the JVM in depth, and touches on the uses of a number of other modern JVM languages including JRuby, Groovy, Scala and Haskell.

Oren Teich and Blake Mizerany on Heroku

Oren Teich and Blake Mizerany talk about the technology behind Heroku and the benefits of the new add-on system.

Security for the Services World

Chris Riley presents security issues threatening service based systems, examining security threats, presenting measures to reduce the risks, and mentioning available security frameworks.

Navigating The Rapids:Real-World Lessons in Adopting Agile

This talk investigates technical issues encountered when moving to an Agile process.