InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Who needs GWT On Rails?

Posted by Sebastien Auvray on Jan 09, 2008

Sections
Development
Topics
Ruby ,
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

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?

Wrap Your SQL Head Around Riak MapReduce

Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.

Polyglot Persistence for Java Developers - Moving Out of the Relational Comfort Zone

Chris Richardson shows how he ported a relational database to three NoSQL data stores: Redis, Cassandra and MongoDB.

The Golden Circle – Why How What

Jean Tabaka challenges the audience to reflect on what Agile practices they are employing, how they are using them, ending with the questions “Why have their organization chosen to go Agile?