Sunday, February 3, 2008

Groovy - Dynamic Language for Java Developers

Every Software Developer should be able to program in both a static and dynamically typed language. There are some situations that call for the flexibility of a dynamically typed language, and others where it makes sense to depend upon a statically typed one. I am more comfortable writing large scale enterprise applications in a statically typed language. However, when it comes to quick little scripts that I need to develop, and would probably never see production, it would make sense in those situations to write these programs in a more dynamically typed language. As a Java Developer, I am very interested in the Groovy language.

Groovy is a very interesting language because it was designed and developed to be compatible with Java. From many of the articles that I have read, you can change many of your *.java files and make it a *.groovy file and *presto* you have a groovy script. It also has the capability of leveraging your existing Java code base. Using Groovy, you can import any of your Java code, and leverage it in your Groovy script.

If you are interested in learning more, Guillaume Laforge has started a series of articles under the title "From Java to Groovy". Currently, there are two installments:

For something a little more advanced, please refer to John Carnell "Lightweight meets Heavyweight: Spring, Groovy and the Enterprise". In this article he demonstrates how to build a JMS message publisher and consumer using Groovy and Spring.

Enjoy.

No comments: