tags:

views:

855

answers:

3

Hi,

Nowadays I hear a lot about "Groovy on Grails" and I want to know about:

  • What is Groovy ?
  • What is Grails ?
  • What kinds of Application are built using Groovy on Grails ?

Thanks.

+2  A: 

Grails is directly analogous to Ruby on Rails, but running with Groovy. What's Groovy ? It's a scripting language that runs on the Java Virtual Machine (JVM).

So you can make use of Java libraries that you already have or are available (since they're compiled to bytecode and thus run on a JVM), plus the power of the JVM (for garbage collection, speed via JIT compilation etc.) and the conciseness of Groovy. The learning curve for a Java programmer to pick up Groovy is supposed to be pretty small (thus leveraging off the huge number of available Java programmers).

It's a very different way of creating web apps to the standard Java mechanisms of servlet programming, JSPs, Java Server Faces etc. Grails (like Ruby on Rails) promises a more dynamic and iterative development environment than the standard development mechanisms (whether that's true in practise, I can't advise)

Brian Agnew
+3  A: 

It would have certainly helped to Google all of this before asking.

But anyway, Groovy is a dynamically typed language for the Java platform. It's a lot like Ruby, but with some Java-like features. Grails is basically a port of Ruby on Rails to Groovy. (Don't know if it's an exact port, but very similar for sure.) As for why you would use Grails: same reasons you would want to use Ruby on Rails, Django, Code Igniter, etc. Dynamically typed languages are much more expressive and easier to code with than statically typed languages.

musicfreak
+27  A: 
  1. What is Groovy on Grails?

    It doesn't exist.

  2. What is Groovy?

    A dynamic and/or scripting language for the JVM.

  3. What is Grails?

    Grails (previously known as "Groovy on Rails") is a programming Framework based on Groovy inspired by Ruby on Rails (there are differences but there are lots of similarities too). Like RoR, Grails promotes "coding by convention", development best practices and is meant to be highly productive.

  4. What kind of Applications are build using "Groovy on Grails"?

    Grails is particularly great for CRUD applications.

  5. What are the advantages of Groovy on Grails?

    High productivity, focusing on business instead of plumbing. (Note that I wouldn't recommend to use Grails with an existing data model. The reason behind this is that Grails encourages a top-down approach where the databases ER model arises as result of the Domain classes. If you are using a legacy database, you cannot take this approach. You must map the database to the domain classes, and probably the naming convention won't match, making necessary the use of hbm.xml Hibernate configuration files or annotations. IMO, this is not a trivial change in the workflow, it can become really cumbersome and you end up loosing most of the advantages of Grails.)

  6. Why would one want to use Groovy on Grails when we have standard programming languages like C/C++, Java/J2EE, and .NET/C#?

    Because of point 5.

Pascal Thivent
+1 A nice practical answer. Almost makes the question worthwhile.
Tom Leys
Can you explain more why you wouldn't recommend using grails with an existing data model?
Todd Hunter
@Todd I removed my previous comment and included it in my answer.
Pascal Thivent