Discuss New Concept,New Technic,New Tools, Including EAI,BPM,SOA,Tibco,IBM MQ,Tuxedo, Cloud,Hadoop,NoSQL,J2EE,Ruby,Scala,Python, Performance,Scalability,Distributed,HA, Social Network,Machine Learning.

Groovy

Oct 162012
 
 [repost ]Groovy/Grails :: Ruby/Rails :: 2011 State of the framework  October 16, 2012  Posted by on October 16, 2012 at 1:47 pm Groovy, Rails Tagged with: , , ,  No Responses »

original:http://stackoverflow.com/questions/4882553/groovy-grails-ruby-rails-2011-state-of-the-framework

Yes, several similar threads exist, but we’re now in 2011, and much has changed.

Grails 1.3.6 has improved hugely compared to v1.3 when I initially tried to learn the framework (and gave up to slow compile times and other groan inducing events).

Having spent a couple months with the latest release, I am impressed, protyping an app is an absolute breeze (GORM is great!). In development mode one no longer needs to restart, barring changes to domain classes. Groovy.lang is fantastic (bare in mind, this is compared to my day job life in PHP).

Now, on the flip side there is Ruby/Rails, which I have little experience with beyond perusing Ruby docs and exploring Active Record (to compare to GORM). Coming from PHP/Jquery, groovy syntax is cake, ruby not so much, although accessible.

Ruby/Rails is all the rage, while Groovy/Grails seems to be picking up speed in its own right.

I’d like to hear what both camps have to say (flame inducing lang war welcome) re: pros/cons of both langs/frameworks now in 2011. When choosing a framework it’s important to know what you’re getting into, so have at it, newbies will benefit, and experts can vent ;–)

—–answer:

Rails and Grails are both excellent frameworks with their current releases. You really can’t go wrong with either. Here are some things I find interesting about them though:

Rails

  • Rails (Ruby) does not scale as well as Grails (Groovy). You will need more horsepower to run your application. This isn’t a big deal at all with PaaS options like EngineYard (and hopefully a AWS BeanStalk Rails option in the future), but it might just cost a little more to run a Rails app vs a Grails app (obviously JRuby is also an option to though).
  • Rails is slightly better with NoSQL alternatives currently, but Grails is catching up quickly
  • Rails has many more plugins, but this can lead to trouble if you use some that aren’t maintained (a lot of them don’t currently work with Rails 3 yet either).
  • Rails is more mature and has more features at this point in time because it’s been around longer
  • Rails REST support is amazing
  • There are many more “big” Rails websites than Grails
  • Ruby is much more popular than Groovy - TIOBE
  • No dependence on Oracle, ha! (Grails obviously needs the JVM)

Grails

  • Grails integrates with the JVM better than JRuby
  • Grails GORM is better than ActiveRecord (IMHO), although Rails 3 opened the door a little bit for other persistence options, but all the books, tutorials, etc all use ActiveRecord
  • Grails View taglibs are better than <=%…%> in view
  • Grails plugins are well documented and clearly state whether they are supported by SpringSource or not
  • SpringSource is investing heavily in Grails
  • There will be many more corporate jobs for Grails than Rails in the future, but more startups use Rails (where do you want to work?)

My perspective

  • I used Rails a couple years ago, I’m working on a Grails project now
  • I like them both better than Django (Python) or Zend Framework (PHP)
  • I plan to learn Lift (Scala) next

My Recommendation

  • If you have never done Java development and are working on a side project for a small to medium website, go with Rails
  • If you are working at a big company that uses Java, try pitching Grails to your management as the “next Java framework” they should invest in
  • If you are working on “the next twitter or foursquare,” well then you are smart enough to answer this question yourself! :)

–answer:

First time I begun a project with Rails I was really surprised:

  • How can I separate “repository” from “Service”? Oh my God: I have to put business logic on controllers… I can’t imagine a real big project with Ruby on Rails: Is there Someone on 37signals remembering the basics of separating Business and Domain/Repository. The Rails folders/classes structure doesn’t take care about this.
  • Second sock: “Active Record”. Try to design a real complex Object Oriented Business layer and map it using the Rails Models (Active Record)… really: don’t.
  • 6 months later, with our project running: R&R is consuming 80% CPU (and memory…) using apache + passanger on a quad core server… and the Postgresql Database is in holidays (3-4% of CPU)… Oh my god (newly)My old ASP/VB6 applications where capable of serve pages to 300 concurrent users in a real backoffice context with real complex databases and complex business installed on a standalone machine (a year 2001 1 CPU core server).

Of course, conventions and Ruby syntax are lovely… and no one needs a compiler (well… unit tests are used for this porpouses 90% of the time… just for solving the dissapeared typing each time I change some code… “Please, programming god, take care about my fingers mistakes” )

First impession with Grails:

  • A “Cool” stack inspired on Rails with professional power based on Spring framework (IoC, Hibernate, …)

And YES!!!

  • There is a clean Domain/Service separation. NICE!!!
  • You can, eventually, forget Java.