Hi all,

Heard of Groovy ?

Groovy, is an agile dynamic language for the Java Platform with many features 
that are inspired by languages like Python, Ruby and Smalltalk, 
making them available to Java developers using a Java-like syntax.

Core strengths - 
 . Developing web applications , 
 . writing shell scripts easily, 
 . writing concise, meaningful, test cases using Groovy's JUnit integration, 
 . prototyping and producing real industrial strength applications

Groovy works cleanly with all existing Java objects and libraries and compiles 
straight to Java bytecode in either application development or scripting mode.

Here are some programming examples (from Groovy site)-

A simple hello world script:

  def name='World'; println "Hello $name!"


A more sophisticated version using Object Orientation:

class Greet {
  def name
  Greet(who) { name = who[0].toUpperCase() + who[1..-1] }
  def salute() { println "Hello $name!" }
}

g = new Greet('world') // create object
g.salute() // Output "Hello World!"


Groovy Leveraging existing Java libraries:

import org.apache.commons.lang.WordUtils

class Greeter extends Greet {
  Greeter(who) 
  { 
      name = WordUtils.capitalize(who) 
  }
}

new Greeter('world').salute()


Using Groovy from the command line:

  groovy -e "println 'Hello ' + args[0]" World

For more details or to learn the language take a look at -
http://groovy.codehaus.org/


thanks
Saifi.

Reply via email to