Rajmahendra has posted 2 posts at DZone. You can read more from them at their website. View Full User Profile

Groovy and Grails Series

02.13.2008
| 2133 views |
  • submit to reddit

Before starting my article Let me first thank Rick Ross for inviting me to IndicZone.com.

Let me post my series of articles on Groovy and Grails which I started in my website and in GroovyZone.com. Hope you like it and post your comments.

Before starting, We need to see why another new tool? In my view, field like IT which is never satisfied with new innovation tools and applications in the modern technology, I am really satisfied with its development. I love innovations and welcome new thoughts. If we are satisfied with what we have then what is life ? Just a old story ? Its changing world and we need to accept new thoughts and do something different.

You may ask questions, Again a new language!? For ex: I am already learning Jruby and Jython.. now one more new Language!? Oops its too much. Don’t worry, not adopting a NEW language but going to adopt new idea on one of the favorite language. YES, Groovy/Grails supports Java and JEE. All your .groovy file will be compiled and changed to .class file! You can jar them and use them. How easy! You need not to worry about learning curve. Its just a Script Language supported by Java platform. Your life goes easy. Really interesting right.

Groovy …

  • is an agile and dynamic language for the Java Virtual Machine
  • builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk
  • makes modern programming features available to Java developers with almost-zero learning curve
  • supports Domain Specific Languages and other compact syntax so your code becomes easy to read and maintain
  • makes writing shell and build scripts easy with its powerful processing primitives, OO abilities and an Ant DSL
  • increases developer productivity by reducing scaffolding code when developing web, GUI, database or console applications
  • simplifies testing by supporting unit testing and mocking out-of-the-box
  • seamlessly integrates with all existing Java objects and libraries
  • compiles straight to Java bytecode so you can use it anywhere you can use Java

Source: codehaus.org/

James Strachan first talks about the development of Groovy in his blog August 2003

Following lines taken from java.sun.com article “Top 10 Cool Stuff Destinations at the 2006 JavaOne Conference”

5. Groovy = Java Technology + Ruby + Python for the JVM* (TS-3273)

Scripting languages such as Python and Ruby are often used to bridge the gap between different languages and platforms, connecting tools and applications that might otherwise never connect. Groovy is an object-oriented scripting language that combines the strengths of both Ruby and Python, and it runs on a Java Virtual Machine (JVM). This session introduces Groovy Markup and other Groovy features, showing you how to build user interfaces and access databases in only a few lines of code. If you like to make quick work of big jobs, Groovy might be able to help you.

Groovy is now undergoing standardization in Java Community Process under JSR 241.

Grails on the other hand is a Web Framework for Java. It is build on the Groovy and J2EE technology. You can easily integrate it with Java libraries. Grails has a wonderful built-in features one of them is the transparent integration of class mapping with Hibernate framework.

Grails has been developed with a number of goals in mind:

  • Provide a high-productivity web framework for the Java platform.
  • Re-use proven Java technologies such as Hibernate and Spring under a simple, consistent interface
  • Offer a consistent framework that takes away confusion and is easy to learn.
  • Offer documentation for those parts of the framework that matter for its users.
  • Provide what users expect in areas that are often complex and inconsistent:
  • Powerful and consistent persistence framework.
  • Powerful and easy to use view templates using GSP (Groovy Server Pages).
  • Dynamic tag libraries to easily create web page components.
  • Good Ajax support that is easy to extend and customize.
  • Provide sample applications that demonstrate the power of the framework.
  • Provide a complete development mode, including web server and automatic reload of resources.

Grails has been designed to be easy to learn, easy to develop applications and extensible. It attempts to offer the right balance between consistency and powerful features
-Wikipedia

Hope you have got the gist of this article you all can learn with me this new budding scripting language and web framework. If you have any suggestions or ideas please post in, I will try to bring it in my future posts.

If you are interested in Groovy and Grails and you are a indian, you can join ‘Indian Groovy & Grail User Group’ @
Google Groups
Indian Groovy & Grail User Group
Visit this group

For any non Indians, you can find grails mailing list @ http://grails.org/Mailing+lists

 

References
Published at DZone with permission of its author, Rajmahendra Hegde. (source)

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