Coding Clarity

Writing simple, clear and readable code.
  • rss
  • Home
  • About Me

Grails is not Rails

chris | November 13, 2007

I have been using Groovy for a little while now and am researching the possibility of using Grails for an upcoming project. At the time, I did not no much about Grails but I had dabbled with Rails a bit and got a feel for how it works.

The .NET community created a project called nant, the .NET port of ant. I’m also familiar with all of the various XUnit variants like JUnit for Java, NUnit for .NET, etc… I just figured Grails was a the Rails application for Ruby ported over to Groovy.

This was not the case at all. Both Rails and Grails are “coding by convention” web frameworks for the Ruby and Groovy languages respectively but they have very different design points. I was familiar with how ActiveRecord works in the Rails world and figured Grails would work the same. ActiveRecord takes a database schema and builds the Object model from the database. In Grails, Object Relational Mapping (GORM) instead using hibernate under the hood.

This article gives a really good summary of the differences in the design approach between Rails and Grails:

Ruby on Rails: RoR uses the bottom up approach where you define your model at the database schema level and RoR builds the model to match using naming conventions. You don’t even have to add the properties to your domain classes as RoR will add them based on the naming conventions of the db schema.

Grails: Grails uses the model-down approach where you define your model and it (or Hibernate technically) builds the schema for you. As I mentioned I don’t like this as a matter of taste since I don’t have as much control over the underlying model. To Grails’ credit, you can fine grain control the database schema by using Hibernate’s mapping, but what a pain.

http://thebull.macsimumweb.com/comparing-ruby-on-rails-to-grails

Categories
Grails, Groovy
Tags
Grails, Groovy, rails, ruby
Comments rss
Comments rss
Trackback
Trackback

« From Waterfall to Agile Java WebDAV Clients »

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recent Posts

  • Changing Maven POM Versions With Groovy and XSLT
  • Using Groovy Templates and Filters Java
  • When to do Unit Testing
  • Write as Little Code as Possible
  • Queue based on a Dictionary in Python

Archives

  • May 2009 (1)
  • March 2009 (1)
  • February 2009 (1)
  • January 2009 (1)
  • December 2008 (1)
  • November 2008 (1)
  • October 2008 (1)
  • August 2008 (1)
  • July 2008 (1)
  • June 2008 (1)
  • May 2008 (1)
  • April 2008 (3)
  • March 2008 (2)
  • February 2008 (2)
  • January 2008 (4)
  • December 2007 (3)
  • November 2007 (3)
  • October 2007 (2)

Categories

  • Blogging (1)
  • Grails (1)
  • Groovy (7)
  • Java (14)
  • Python (1)
  • Software Development (14)
  • XSLT (1)

Tags

agile blogger Blogging C++ classloading commons-logging Customers CXF dynamic languages eclipse execution games GPL Grails Groovy House HTTP http authentication jackrabbit Java javascript LGPL licensing log4j logging maven metaprogramming open source Python rails ruby slide Software Development subversion Support unit testing URL version control vista waterfall webdav Web Services windows genuine advantage wordpress XBox

Blogs I read

  • BlackBox
  • Code For Fun
  • Coding Horror
  • Graeme Rocher
  • Joel on Software
  • Raganwald
  • Rands In Repose
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox