Java J2EE Portal
Enterprise Java Station
J2EE curve
Java News / Articles
Java News / Articles
Netbeans_Jdeveloper_Eclipse
Java IDEs - NetBeans vs Eclipse vs JDeveloper
Java conference
JavaOne Notes, Plans And Session Picks
Synergies between J2EE, SOA and Web2.0
Processing...
Buy Java, Deals On Software Technology Store
Click here for great deals on computers, laptops, software and books
Groovy bridges the scripting and the enterprise Java worlds PDF Print
Written by Content Team   
Apr 06, 2006 at 06:26 AM

GuillaumeLaforgeGroovyScripting / agile / dynamic languages for Java have been around for some time. However they seem to be getting more attention lately, because of the growing popularity of languages like Ruby and frameworks like Ruby On Rails. So the Java community looks hungry for an alternative to Ruby On Rails and a scripting language that it can easily adopt using Java knowledge. Enter Groovy and Grails.

In this interview, we speak to Guillaume Laforge, the project manager for Groovy and the initiator of Grails. Guillaume sounds very excited about the features of the Groovy language and he also feels that Grails which was originally "Groovy On Rails" is the ROR alternative for Java that the community has been looking for.

Do share your thoughts on scripting and groovy using the comments form on the last page of this interview.

IndicThreads >> Welcome to IndicThreads. Could you introduce yourself?

Guillaume Laforge >> Hello dear IndicThreads readers! My name is Guillaume Laforge. I’m the Groovy Project Manager, and one of the core committers on the project. I’ve been participating in the development of the project for already over 2 years. In my “real life” – professional life that is – I’m a Software Architect at OCTO Technology (http://www.octo.com), a French-based IT consulting company dedicated to architecture.

IndicThreads >> The confusion with scripting languages really begins with the word scripting. Very few Java developers are sure of what is scripting. To add to it, these languages are also referred to as agile or dynamic. Could you help us understand what are scripting languages and what's the need?

Guillaume Laforge >> It’s tough to give definitions for these words! Because almost everybody has its own definition of what scripting, dynamic or agile mean. So I’ll give you my own definitions instead – some might disagree with this classification.

"Everybody has an own definition of what scripting, dynamic or agile means..."

Usually, scripting languages refer to languages which are interpreted, but not compiled. They are mostly used and live on the command-line, in shell environments, like bash. Those languages are often used to “script” some live applications, objects or components, to manipulate them programmatically, and potentially interactively.
Agile is often used to refer to language that offer some syntax sugar or simplified APIs to do some common and somewhat complex tasks in an easier way, giving you more productivity gains than a general-purpose language. The idea is to help you do complex tasks easily, either by providing simple APIs or by giving you an expressive syntax.

Groovyteam
Groovy Team: Left To Right: Guillaume Laforge,
Jochen Theodorou, Dierk Koenig, Jeremy Rayner,
John Wilson and James Strachan

Then comes the term “dynamic”… it conveys two distinct meanings, but it is often used mistakenly interchangeably for those two meanings. Languages that are “dynamic” are often called so because they support “dynamic typing”, or weak typing: you can omit type information when passing parameters or defining new variables or fields. It is different than say in Java which is strongly typed and requires you to prefix every parameter, or instance with a type upon declaration. Talking about dynamic languages this is a bit misleading; we should say dynamically-typed languages instead, to be more accurate.

The second meaning of “dynamic” is more interesting in that is refers to languages that offer some kind of dynamic features in the form of meta-programming capabilities. Then you might ask what is meta-programming? It’s like programming, expanding, extending, manipulating the language constructs themselves. For example: adding new methods on an object at runtime, intercept non-existent method calls, injecting or changing the behavior of an object. We also speak about the MOP: the Meta-Object Protocol, which represents all the manipulations you can do on your language and its constructs.

If we take those definitions for granted – and I know some may disagree with my own definitions – Groovy is a scripting language because it can be interpreted at runtime, despite it can also be pre-compiled as normal Java classes are (in the form of .class files full of bytecode instructions). But Groovy is also a dynamic language in both senses of the term: it can be dynamically typed (though it also supports static typing), and it also offers a MOP, a way to add and manipulate language constructs to extend its capabilities.

As to what’s the need of those families of languages, it really depends on your use case. In a lot of cases, you won’t need such a language, and you’d probably better use a full-blown statically-typed language with a nice IDE to work with. But scripting languages come in handy for prototyping spikes, for small to mid-sized projects where the expressivity matters more, or for integrating some customized logic to be interpreted or changed at runtime for bigger enterprise applications.

IndicThreads >> Great! That would have been a big help to many readers. Now coming to Groovy, who's the target audience for Groovy? Java developers or developers from the scripting world wanting to use the power of Java through a language more suited to their tastes?

Guillaume Laforge >> The main target audience is the Java developer crowd. Groovy’s been conceived with those Java developers in mind. That’s why its syntax is quite close to Java’s syntax. We wanted to make a language that developers could use to glue components together, to write quick shell-like scripts to do some administrative tasks, to give means to add some expressivity to your business rules you could embed in your Java application.

"Groovy somehow bridges two worlds: the scripting world and the enterprise Java world..."

But I’ve been told quite recently that Groovy is even taught to students in some universities as a first or second language. And we also hope we’ll attract to the Java platform some scripting fans like PHP developers. Groovy somehow bridges two worlds: the scripting world and the enterprise Java world.

"Groovy's main target audience is the Java developer crowd..."




Add This Feed Button

Enter your Email


Java Expert Interviews
Jesper_Joergensen
WebLogic 9.0 takes J2EE to a new level of reliability and scalability
JonasJacobiJSFAjax
Pure Ajax creates the next generation legacy applications
Sameer Tyagi Sun
Understanding Web Services and SOA
Processing...
Go to top of page  Home |
SiteMap

Copyright 2004 to 2008 Rightrix Solutions. All rights reserved. All product names are trademarks of their respective companies. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Rightrix Solutions and IndicThreads.com are independent of Sun Microsystems, Inc.

Views expressed at IndicThreads.com reflect the views of the authors alone, and do not necessarily reflect those of IndicThreads.com. IndicThreads.com and it's authors are not responsible for reader comments and opinions.

Enterprise Java J2EE JEE Portal >> IndicThreads.com