The document discusses Groovy, a dynamic language for the Java Virtual Machine. It has features from Python, Ruby, and Smalltalk, but uses Java-like syntax. Examples show Hello World programs in Java and Groovy. Later sections discuss Grails, a web framework for Groovy, and G*Magazine, a publication about Groovy. The document contains code samples for defining a Book domain class in Grails, implementing services with Spring Security annotations, writing Spock specifications, and Geb tests using the Page Object pattern.
4. JSR241
• Groovyis an agile, dynamic
programming language for the Java
Virtual Machine.
• Groovyincludes features found in
Python, Ruby, and Smalltalk, but
uses syntax similar to the Java
programming language.
2011 9 23
5. HelloWorld.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
2011 9 23
6. HelloWorld.groovy
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Java
2011 9 23
28. class Book {
String title
String isbn
static constraints = {
title blank:false
isbn blank:false, unique:true
}
}
2011 9 23
29. class Book {
static mapWith = 'mongo'
String title
String isbn
static constraints = {
title blank:false
isbn blank:false, unique:true
}
}
2011 9 23