Friday, January 17, 2014

Major Reasons to Deliberate Groovy and Grails For Software Architecture

Groovy is an object-oriented programming language for the Java platform. It is a high-productivity framework that follows the "coding by convention" paradigm to provide a stand-alone development environment while hiding much of the configuration detail from the developer. And Grails is an open source web application framework that uses the Groovy programming language. Grails provide a web framework for java platform.
Lot of companies are adopting Groovy and Grails now, and are not using old stuff like Spring and Hibernate. Grails is just not a good replacement for vanilla Spring/Hibernate, but it's even more better as it is built on top of these frameworks and use "Convention over Configuration" paradigm improving the development productivity by many folds.
What makes Groovy and Grails a better choice lets discuss here the top 5 reasons.
1) Offers a dynamic Framework
A good framework is nothing without good documentation, serious support and a large community of contributors. On a good note Grails have all that. First of all, they are part of the portfolio of SpringSource, the very company that brought you the Spring Framework and that is now a division of VMWare. The documentation is really good, like most Spring documentations. In terms of ecosystem Grails has a very dynamic ecosystem ,it has a plugin mechanism that makes it really easy to extend the framework in a lot of different ways.
In Groovy lot lesser stuff is checked at compilation time than with Java, but since the code is much more expressive, there is a lot less opportunity for errors too, and unit tests are a lot easier especially thanks to DSL's.
2) Groovy does not just limits to scripting
Groovy is indeed great for system scripting, just like Ruby and Python are. Since scripts does not require a class so scripts can be written in a less time span.Groovy is a scripting type language that is very close to Java, but adds features that Java doesn't have like closures and mix-ins . But a lot of people are not aware of Groovy's dynamic features and use Groovy just for scripting purposes, and not really use it for big prime-time applications. But it still unknown to many that most of Sky's software (the British broadcast network) are built with Groovy and Grails.
3) In-built testing tools available
The code written in Groovy is quite lesser than Java, so there is no need to explicitly import java.util classes as Groovy automatically import them and it also does not require any semicolons. It makes Java coding easier.
In Grails 2.0, a collection of unit testing mixins is provided by Grails that lets you enhance the behavior of a typical JUnit 3, JUnit 4 or Spock test. You need not have to import any of the testing classes because Grails does that for you.
Groovy simplifies JUnit testing in several ways, including:
  • JUnit is built into the groovy runtime, so you can script JUnit tests for your Groovy and Java classes using Groovy syntax.
  • Groovy provides many additional JUnit assertion statements
  • Groovy unit tests are easily scriptable
4) Ease of deployment
Developing an application and getting it into production with Grails is faster than anything as Coding (or configuration) by convention allows you to concentrate more on what application is supposed to do rather than on how to get it configured properly, which makes development easier and more productive.
Grails doesn't require any special deployment considerations,it generates a WAR (Web ARchive) that will run on any standard servlet container making it easier to deploy in environments for deploying applications onto servers like WebSphere,Tomcat or Weblogic.
5) Groovy runs on JVM just like java
Groovy is a superset of Java. It is so Java-rooted that it actually compiles to run on a Java runtime. Groovy code compiles into JVM bytecode, which means it makes Groovy and Grails applications run on any of your favourite application server like Tomcat, JBoss or even Weblogic and you can reuse all the available libraries in the Java ecosystem in an instant. It's designed for the JEE platform and standard Grails download includes all the Java libraries and a Tomcat or Jetty servlet engine to get started. You can even mix java code in your Grails application and can use any Java classes in your Groovy application.


No comments:

Post a Comment