15 Reasons Why You Should Use The Grails Web Application Framework

Grails is a high productivity framework for JVM, based on Groovy language.  It has been around since 2006. Since then, innumerable sites have successfully been launched using the framework. Below are 15 reasons that make Grails the web development framework of choice:

  1. Based on tested and proven frameworks :
    Grails itself has been used by a lot of big enterprises and products such as Sky, LinkedIn, WalMart, ESPN, etc and Grails is no-longer a new technology now. The underlying technologies are already  proven and tested frameworks (Spring, Hibernate, SiteMesh, etc) with a very huge user base.
  2. Groovy language:
    Groovy code is much more concise, expressive and DRY than Java code, which means there are fewer lines of code, which translates to much higher developer productivity and less code to maintain.
  3. Easy to set-up and get started:
    It is very easy for a Java developer to get started with using Grails; and start experiencing the joy of web-application development with Grails.
  4. GORM:
    Grails’ object relational mapping (GORM) provides a very easy-to-use and flexible layer over Hibernate and few other non-relational Data Sources.  This makes it extremely easy to talk to any GORM supported Data Source. GORM supports all relational databases which are supported by Hibernate (JDBC); and it also supports other Data Sources such as Redis, MongoDb, etc.
  5. Doesn’t stop you from using the power of underlying frameworks:
    GORM does a good job of shielding you from dealing with Hibernate directly. But at the same time, if you want to bypass GORM and directly use hibernate API, map POJO/POGO to existing tables, then it does not stop you from doing so. Similarly, you can use the underlying power of Spring if you were to do so. Similarly,  you are not forced to use Groovy, you can choose to use Java or stronger typing wherever you want/need.
  6. DRY / Convention over Configuration / No painful XML configuration & XML Management:
    You don’t have to write all of the plumbing/boilerplate code yourself when using Grails. This allows the developer to spend more time on writing code for developing features rather than struggling & configuring the framework components. Grails uses convention over configuration, uses sensible defaults and auto-wires based on simple naming conventions.
  7. Scaffolding:
    Scaffolding utilities provided by Grails is a great advantage when building prototypes to validate the idea; or to build Admin interfaces. For a lot of new developers evaluating Grails, scaffolding is the first thing that brings the “wow” effect.
  8. Built-in REST support:
    Grails includes flexible features that make it easy to create RESTful APIs. Creating a RESTful resource can be as simple as one line of code. With modern hardware featuring multiple cores, Grails has now a great support for Asynchronous Programming API as well.
  9. Tag Lib Authoring mechanism:
    Grails makes it quite easy to modularize and reuse view layer code; especially because of the ease with which tags can be created. It is as easy to write a tag in Grails as it is to write a Java or a Groovy class.
  10. Integrates easily with already written Java code:
    Grails/Groovy integrates easily with code already written in Java. You can even intermix Java and Groovy code in the same file and it will work just fine. On one hand, it allows a Java developer to start using Grails very quickly; on the other hand; it allows use of already written Java code.
  11. Plugin based development approach for modularity and reuse:
    Grails promotes reuse of code between different Grails application by modularizing your application in the form of plugins. Taking a plugin-centric development approach promotes and forces clear separation of concern and easy reuse.
  12. Tons of available plugins:
    Grails has over one thousand plugins which have been contributed by the core development team and other Grails application developers. More often than not, if you want to integrate an existing framework or use an API, you will find a plugin to make the integration much easier.
  13. Minimal server restart required while development:
    While developing with Grails, you don’t need to restart your web-container after making every change. It uses an intelligent mechanism to reload and apply your changes. (There are very less cases where Grails requires container restart). This saves lot of development time wasted in server restarts.
  14. A very responsive and supporting community and mailing list:
    Grails is not only about technology, it has a very responsive and supporting community. There is hardly any question that doesn’t get answered on the mailing list.
  15. Hundreds of small things that make development fun with Groovy and Grails:
    Can’t explain this, in order to understand this, you need to develop with Grails for a week and you would know.

*Check out GrailsConf India, India’s first Groovy-Grails conference

Amit Jain

Amit Jain is a Software Developer with 5+ years of experience in Java and Grails development. He is the author of Remote-Pagination plugin, an Agile enthusiast and a Certified Scrum Master. For the last 4 years he has been working with IntelliGrape, a company which specialises in Groovy & Grails development, Agile offshoring & projects.

7 thoughts on “15 Reasons Why You Should Use The Grails Web Application Framework

  • February 8, 2014 at 5:42 pm

    Thank U very mutch for this article. I’m news in Grails and I’m Happy to use It 🙂

  • January 12, 2014 at 7:37 pm

    I definitely prefer the robust strong typing of Java over groovy. But perhaps use the grails framework but write all code in Java? Is that a reasonable idea?

    • January 13, 2014 at 2:05 pm

      Yes that can be done, just that you may loose some power that groovy can provide. Although I won’t go for that personally, would rather write test cases for some critical pieces of code. You can avoid using “def” in groovy and use specific types, i guess that works for us. At the same time there is no issue with using JAVA in Grails. Thanks

  • January 11, 2014 at 7:10 pm

    Node and express is so much faster that it almost makes your post ridiculous 🙂

    • January 13, 2014 at 12:38 am

      If you’re going to write single-threaded server code then why not run your server applications on a single threaded OS like DOS? You could put up a DOS virtual machine for each server. Yeah, let’s go back to the good old days of single threaded applications.

Leave a Reply