2007-06-19

GWT versus Rails

I recently got into a debate with a friend of mine about which is better for developing web applications - Google's Web Toolkit (GWT) or Ruby on Rails. He argued for GWT, I for Rails. Neither one of us convinced the other, although we both got each other to watch the frameworks' respective screencasts (GWT, Rails).

Disclaimer: I've done quite a bit of Rails, but not any GWT, and I'm rusty with Java. So I may be totally off base with some of my analysis, but that's what the comments are for (besides, what else is new?).

Anyway, without further ado:

Advantages of GWT over Rails


  • It's FAST. GWT is designed to be lightning fast, and as far as I can tell, it's pretty much as fast as it's going to get for an HTTP application.

  • It scales extremely well. Because GWT relies quite heavily on the browser, there are fewer HTTP requests to the server, and the requests themselves are smaller. The ImageBundle widget is a great example of this.

  • GWT gives you a toolbox of graphical user interface widgets to build your application with out of the box.

  • There's compiling. That catches quite a few errors before deployment.

  • Java is a much more mature language than Ruby.


Advantages of Rails over GWT


  • Database support. It is very easy to work with almost any database in Rails with almost no configuration. Rails also gives you RDBMS-agnostic migrations so you can update your database without writing any SQL. In fact, you don't even have to manually create any tables in your database - Rails will create migrations for you to do that when you create your models. GWT has none of this as far as I can see.

  • Multiple Environments. Rails supports as many environment types as you can think of. Out of the box they give you basic code for a development environment, a testing environment (more on this later), and a production environment. This includes different database connection strings for each. Simply change RAILS_ENV to whatever environment you're in.

  • Ruby is a much easier language to learn and work with. It's also much lighter-weight as far as the amount of code you have to write.


This post may get updated as I think of more pros and cons for each. Stay tuned!

--YY

8 comments:

Anonymous said...

Database support rails: gwt with hibernate has the same features.

YodaYid said...

ActiveRecord for Rails is much easier to use than Hibernate. You don't have to specify getters and setters, for example - Rails figures them out automatically. There appears to be much more configuration involved with Hibernate. You need a mapping file to map each of said getter/setter functions to its corresponding database column. Again, Rails does this for you automatically.

Tio Malandra said...

YodaYid:
1- I assume you don't know Hibernate Annotations: It's easier than ActiveRecord and much more Object Oriented.
2- Comparation of GWT with Rails y like comparation of tangerines and oranges: Rails is server side technology and GWT is client side, you can use GWT with Rails in the same application.

YodaYid said...

Tio - you're right - I didn't know about Annotations. They're a big step up from Hibernate Core. I wouldn't say that they're easier to use than ActiveRecord though.

If I was to start a new web project today, I would basically decide whether to go with Rails or GWT. In that sense they're certainly comparable. I haven't found any documentation on how to get the two to communicate.

Thanks for the comments!

Ilya said...

Client-side GWT can work with any programming language if you use the same serialization method (JSON or XML).

YodaYid said...

Thanks - I guess I thought GWT had more of a server-side component than it does.

Viorel said...

Have a look here for an example of integration between GWT and Rails.

http://code.google.com/p/gwt-on-rails/

Anonymous said...

Java is a much more mature language than Ruby...

Ruby has been around since 1993. Java is circa 95.