Main
Java

« C# 2.0 / Java 5 compared. | Main | LINQ : Language Integrated Query. »

November 15, 2005

Groovy : A case for Java's Scripting Language.

If you have used more than three programming languages in your career, then you know first hand how awkward and even difficult it is to perform the same operation in different languages, your mind may spin around for a few minutes thinking 'How do I...seemed easier in...'.

[Entry continues to the left and below ad ]

For the market share Java has in software development, some things are still simply 'not easy' to perform, perhaps in a few more versions they will be easy, but what about now ? As it turns out, there is a current and different approach to Java -- and its not as simple as saying 'use C# or Ruby, instead'-- it plays well with your other Java classes and can even be executed in the same JVM, its name: Groovy

In all fairness, Groovy is not the only language that plays well with Java and can be executed in a Java-JVM, languages such as Jython, JRuby, Jacl and Beanshell let you use more powerful syntax -- relatively speaking -- or use idioms available in other languages, all of which are eventually converted into the same byte code -- .class file -- that is executed by your standard Java JRE. (Note of interest : Most of these languages achieve Java pluggability through BSF )

But what sets Groovy apart from the rest ? For starters it has its own JSR -- Groovy JSR-241 -- which is Sun Microsystem's way of formalizing technology designed around the Java platform, this should be enough to keep managers & C*O comfortable for allowing Groovy inside an organization.

Syntax wise Groovy is extremely compact. Using a GroovyBean , a standard JavaBean's code can be reduced by probably a third or more, Groovy Regular Expressions are also much simpler to declare, and of course, serious scripting support through Groovy builders for markups related to DOM, SAX, XML, Ant & Swing. But one more important thing to note about Groovy, it's the basis for Grails , a toolkit designed around the same paradigm as Ruby on Rails intended to reduce the complexity of creating web applications.

If you can work out the switch, for alternating between slightly different syntaxes when you program in Java, in order to gain a degree in speed under certain scenarios, then you should look at Groovy. If you were impressed at what can be done with Ruby on Rails , but you do not have the intention of making the Ruby switch, then you should seriously consider Groovy, since it will get you closer to Ruby on Rails flexiblity without completly parting the Java world.

[Comments below ad ]

Posted by Daniel at November 15, 2005 8:46 PM


Comments


Post a comment




Remember Me?

(you may use HTML tags for style)

Track back Pings

Track Back URL for this entry:
http://www.webforefront.com/mtblog/mt-tb.cgi/32.

 
XHTML 1.1   Powered by Movable Type 3.33