Philip has posted 9 posts at DZone. View Full User Profile

Groovy / Grails Update from G2One at the No Fluff Just Stuff Meetup

05.06.2008
| 12219 views |
  • submit to reddit

This gathering was put on by the people who take the excellent NFJS series around the United States throughout the year. I was fortunate enough to attend my first one just a few weeks ago in Seattle and am happy to say that in the course of one weekend, the symposium reminded me of so many reasons why I got into developing software. With that kind of introduction you might think I would have high hopes for the session here tonight and you are right! Fortunately for the 250 or so people, we weren’t to be disappointed.

Groovy

We began with an update on the Groovy / Grails project from the G2One VP of Technology and initiator of the Groovy project, Guillaume Laforge. He started by telling us a bit about Groovy, it started in 2003 with the following goals:

 

  • To simplify the life of developers
  • Seamlessly integrate with the Java platform
  • Be dynamic to open up possibilities
Five years later it is has:
  • More than 5,000 downloads per month, peaking at 10,000 with a new release
  • Over 1,000 mailing list subscribers
  • Up to 1,000 messages per month on the list
  • After last years Groovy / Grails talks at JavaOne there were over 7,000 downloads in just one week!

 

Guillaume then went on to detail a few of the big success stories out there, the first one being Mutual of Omaha with 50k lines of Groovy code, half of which is business related and half test code. They use it as a risk calculation engine for insurance policies and involved Java beginners and domain experts when writing their code. Key selling points for them were:

  • Big decimal arithmetics (supported by default in Groovy)
  • Perfect Java integration
  • Closures

The above points make it an ideal language for business rules expression.

Some of the key points about Groovy for those of you who haven’t come across it yet are as follows:

  • Groovy is java like
  • It has a flat learning curve
  • It is simpler than java for beginners and domain experts
  • You can mix and match java and Groovy code together
  • It uses the same Strings, regex, security/threading/OO model
  • It is not a new paradigm and platform
  • And there is no impedence mismatch
  • In release 1.5, they added Java 5 features, annotation support, generics, enums etc
  • And also brought in EJB3, JPA, Hibernate, sprint annotations, testNG, JUnit4
The new release of Groovy, version 1.6 beta-1 came out last week sporting some pretty impressive performance gains over previous releases that put it above all the other dynamic languages.

Grails

The Grails update was next and we’ll start here by setting the scene:
  • Web frameworks before Grails were boring and painful to work with, too many configuration files to mess about with and you always had to redeploy locally to test changes
  • Ruby on Rails was the rage. Guillaume said this of Ruby: “Great principles such as convention over configuration, Don’t Repeat Yourself (DRY) and so on, but it was an unconventional paradigm and platform.”
  • The Grails team wanted to help people protect their investment in the Java platform by using the JVM
  • They adopted a philosophy of “Build on shoulders of giants” as can be seen here in the list of open source technology they used:
  • Spring (DI), Hibernate (OR mapping, handling legacy schemas), Jetty, SiteMesh (for page layout and componentization), AJAX libraries (richer experience)

Grails 1.0 was released in February of 2008 and is now downloaded 14,000 times per month. There are lots of Grails plugins available, provided by what Guillaume referred to as the “super active community”. A few examples of the more popular plugins are:

  • Searchable
  • New view technology or toolkit integration – GWT, Wicket, YahooUI
  • Web Services – Axis, XFire
  • Secutiry Integration
  • Enterprise oriented – JMS, LDAP, Mondrian, JasperReport

There are already 3 million lines of code in the plugin SVN repository now.

The Grails success stories are as impressive as the Groovy ones, in particular the fact that SAP integrated Grails in order to make it possible to quickly write new front-ends on top of their existing java based NetWeaver composition platform. The big bonus for SAP was that Java developers could quickly get up to speed on Grails.

Sky, the major subscription TV provider in the UK built a new showbiz website that is attracting a massive 186 million page views per month using Grails and have not had any performance problems. Sky is now currently rewriting their main site in Grails.

There were some very good questions and answers following these two sessions, a highlight of the Q&A follows:

Q: What is your view on using groovy as the main language on the JVM?

A: Guillaume – ‘Groovy is meant to be complimentary to Java, not a replacement’. He continued “Java is wonderful for writing highly performant code, but dynamic languages will always be slower than static languages. What is nice is that Groovy could be a playground for ideas that might end up in Java later”.

Q: The reverse of the previous question – Is there a strategy for language compatibility?

A: Guillaume responded: “Between 1.x releases intent was to be backwards compatible, but code might need to be recompiled.” They care about not breaking compatibility unless it is absolutely necessary which may be the case for Groovy 2.0 in order to gain major performance gains.

Q: How does Grails distinguish itself from Ruby on Rails?

A: “Grails is not a clone, only the principles of Rails were brought to running on a JVM. The key differentiator is integration with the JVM, way more advanced with Grails than Ruby on Rails, even with JRuby on Rails.

That put us out of time for Guillaume’s session which was followed up with a brief from the folks at LinkedIn, who are now using Grails to create solutions for a team that needs to be fast to market in delivering their product.

At this point there was a break in proceedings while everybody was treated to some free appies and drinks and the session resumed with an expert panel discussion, the detail of which will be added to a follow up article later in the week.

Published at DZone with permission of its author, Philip Cornthwaite.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

James Ervin replied on Wed, 2008/05/07 - 2:03pm

I was also in attendance and had some comments myself.

http://iacobus.blogspot.com/2008/05/remarks-from-groovy-meetup-before.html

 I am really impressed at how Groovy feels like it is ready for prime-time, unlike its state soon after Java One in 2004 where I was first exposed to it.  Also the statistics on Grails, wow!  It shows that it is a platform that can do alot of what people like about RoR without the issues that have become so apparent these days.

 

Bob Jones replied on Thu, 2008/05/15 - 11:16am

I attended several Groovy/Grails sessions at the recent JavaOne 2008, and I was really impressed. It makes me giddy to start programming again! Of course, as the article stated, there will always be a small performance hit when running Groovy (on top of Java), but historically that argument has always fallen down when hardware speeds up (which it always does). So in the request-response cycle of a typical page or Ajax request, the speed "hit" is really just a rounding error. Furthermore, we hear a lot about the "user experience" -- I like how Groovy focuses on the "developer experience". (Which is why I feel the giddiness, I suppose). IMHO, it's better to save development time and throw another server on than to slow a developer down and save a server, if you know what I mean.

The features of Groovy that I really love and were not mentioned in this post are:

  • the ability to intercept method calls (a la AOP) and even catch missing method calls and add them dynamically to the object!
  • function pointers (very similar to the "closure" concept)
  • no need to write setters and getters on POJO/POGO properties (but you always can if you need extra logic there)
Grails is a stunning piece of work, too. Definitely going to keep my eye on this stuff. It's really cool.

Dennis Portello replied on Wed, 2008/07/02 - 9:39am

Grails is certainly some great stuff for most use cases, but I keep smacking my head against the wall when I need to account for those tricky edge cases. I've spent the last few days chasing snap-shot builds to get things like annotations working on groovy domain classes. Also, some of the generated views and controllers can be a slippery slope.

 Overall, it's a fantastic technology, I'm not ready to use it for every project, but it can certainly get the easier tasks done very quickly. I'm looking foward to what the future will bring.

Carla Brian replied on Fri, 2012/05/04 - 9:14am

I am new with Groovy. I think I need more materials on this. I need to read more and study more about this. - James P Stuckey

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.