What are "Groovy" and "Grails" and what kinds of applications are built using them?

GrailsGroovy

Grails Problem Overview


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

  • What is Groovy?
  • What is Grails?
  • What kind of applications are built using Groovy on Grails?

Grails Solutions


Solution 1 - Grails

  1. What is Groovy on Grails?

    It doesn't exist under this name anymore. It's simply called Grails now.

  2. What is Groovy?

    Originally, a dynamic language for the JVM. However, since Groovy 2.0, both static and dynamic typing are supported.

  3. What is Grails?

    Grails (previously known as "Groovy on Grails") is a programming framework based on Groovy and 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 built using "Groovy on Grails"?

    Grails is used to build web applications that run on the JVM.

  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 losing 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.

Solution 2 - Grails

Groovy is an object-oriented programming language for the Java platform. It is a dynamic language with features similar to those of Python, Ruby, Perl, and Smalltalk. It can be used as a scripting language for the Java Platform. Groovy has a Java-like syntax and works seamlessly with Java bytecode.

Other features include:

  • Easy learning curve
  • Support for domain-specific languages
  • Compact syntax
  • Support for dynamic typing
  • Powerful processing primitives
  • Ease of Web application development
  • Support for unit testing.

Grails is an open source web application framework which uses the Groovy programming language. It is intended to be a high-productivity framework by following the "coding by convention" paradigm, providing a stand-alone development environment and hiding much of the configuration detail from the developer.

Like Rails, Grails seems to be what I call "Strongly Grained". If you do things the Grails way, development is easy (and generally quite fast). The framework tends to have a preferred way of doing most things. On the other hand, if you need to go against the grain, you'll have a comparably rough time of it.

And don't say Groovy on Grails(doesn't exist), for reasons refer to this blog.

Solution 3 - Grails

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)

Solution 4 - Grails

Grails- MVC framework for developing a web application and a ready to code platform with DRY (Don't repeat yourself) built on the top of Spring+Hibernate. Grails platform takes care of the infrastructure and dependencies to run a web app such that the developers can concentrate on building the functionalities for the product. Grails -a great framework for the startup organizations to launch the product from the development mode to production mode.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRachelView Question on Stackoverflow
Solution 1 - GrailsPascal ThiventView Answer on Stackoverflow
Solution 2 - GrailsJainendraView Answer on Stackoverflow
Solution 3 - GrailsBrian AgnewView Answer on Stackoverflow
Solution 4 - GrailsPavithra RView Answer on Stackoverflow