This document appears to be slides from a presentation about Groovy and Grails. The slides cover topics like: the history of Groovy; Groovy's integration with Java; Groovy's syntax including closures, collections, and meta-programming; and Grails' use of Groovy for web application development. Later slides discuss how Groovy is implemented and distributed, and some Groovy features like Grape for dependencies and Power Assert for assertions.
10. , ,
class City cities
class City {
def name;
def country;
long population;
}
cities = [
new City(" "," ",35676000),
new City(" "," ",19040000),
new City(" = ","
:
Slide# 10 JGGUG Grails/Groovy 3 / 2009.09.25
13. :
Script.groovy result = 1
10.times {
result *= 2
}
assert result == 1024
Script
result = 1
10.times {
result *= 2
}
assert result ==
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
14. :
Script.groovy result = 1
10.times {
result *= 2
}
assert result == 1024
Script
result = 1
10.times { Integer(10)
result *= 2
}
assert result ==
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
15. :
Script.groovy result = 1
10.times {
result *= 2
}
assert result == 1024
Script Integer (10)
result = 1
10.times { Integer(10) def
result *= 2 times(Closure c){
} c.call() 10
assert result == }
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
16. :
Script.groovy result = 1
10.times {
result *= 2
}
assert result == 1024
Script Integer (10)
result = 1
10.times { Integer(10) def
result *= 2 times(Closure c){
} c.call() 10
assert result == }
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
17. :
Script.groovy result = 1
10.times {
result *= 2
}
assert result == 1024
Script Integer (10)
result = 1
10.times { Integer(10) def
result *= 2 times(Closure c){
} c.call() 10
assert result == }
{
result *= 2
}
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
18. :
Script.groovy result = 1
10.times {
result *= 2
}
assert result == 1024
Script Integer (10)
result = 1
10.times { Integer(10) def
result *= 2 times(Closure c){
} c.call() 10
assert result == Integer#times }
{
result *= 2
}
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
19. :
Script.groovy result = 1
10.times {
result *= 2
}
assert result == 1024
Script Integer (10)
result = 1
10.times { Integer(10) def
result *= 2 times(Closure c){
} c.call() 10
assert result == Integer#times }
{ (call)
result *= 2
}
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
20. :
Script.groovy result = 1
10.times {
result *= 2
}
assert result == 1024
Script Integer (10)
result = 1
10.times { Integer(10) def
result *= 2 times(Closure c){
} c.call() 10
assert result == Integer#times }
{ (call)
(call)
result *= 2
}
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
21. :
Script.groovy result = 1
10.times {
result *= 2
}
assert result == 1024
Script Integer (10)
result = 1
10.times { Integer(10) def
result *= 2 times(Closure c){
} c.call() 10
assert result == Integer#times }
{ (call)
(call)
result *= 2 (call)
}
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
22. :
Script.groovy result = 1
10.times {
result *= 2 (result)
}
assert result == 1024
Script Integer (10)
result = 1
10.times { Integer(10) def
result *= 2 times(Closure c){
} c.call() 10
assert result == Integer#times }
{ (call)
(call)
result *= 2 (call)
}
Slide# 13 JGGUG Grails/Groovy 3 / 2009.09.25
23. :
import javax.swing.*
import java.awt.event.*
f = new JFrame(size:[200, 100])
title = "hello"
b = new JButton(title)
b.addActionListener({println title} as ActionListener)
f.contentPane.add(b)
f.show()
as
1 implements
key,
value
Slide# 14 JGGUG Grails/Groovy 3 / 2009.09.25