Groovy
![]() |
|
| : |
2003 |
|---|---|
| (): |
|
| : | |
| : | |
| : | |
| : | |
Groovy - Java Java Python, Ruby Smalltalk.
Groovy Java- JVM - Java . Java .
Groovy Java Community Process JSR 241.
Groovy ( Java):
|
|
[]
class Foo { def doSomething() { def data = ["name": "James", "location": "London"] for (e in data) { println("entry ${e.key} is ${e.value}") } } def closureExample(collection) { collection.each { println("value ${it}") } } static void main(args) { def values = [1, 2, 3, "abc"] def foo = new Foo() foo.closureExample(values) foo.doSomething() } }
[]
Groovlets Groovy .
GroovyBeans Groovy JavaBeans.
Java, Groovy , main Runnable GroovyTestCase:
#!/usr/bin/env groovy println "I can execute this script now!"
Groovy: Java Strings GStrings .
def javaStyleString = 'java String style' def GStringsStyleString = "${javaStyleString}" def j = '${javaStyleString}' def bigGroovyString = """ ${javaStyleString} ${GStringsStyleString} """ println bigGroovyString
Groovy (setColor(String color) getColor()):
class AGroovyBean { String color } def myGroovyBean = new AGroovyBean() myGroovyBean.setColor('blue') assert myGroovyBean.getColor() == 'blue' myGroovyBean.color = 'green' assert myGroovyBean.color == 'green'
Groovy , :
def myList = ['One', 'Two', 'Three'] // , assert myList[2] == 'Three' myList[3] = 'Four' // assert myList.size() == 4 def monthMap = [ 'January' : 31, 'February' : 28, 'March' : 31 ] // assert monthMap['March'] == 31 monthMap['April'] = 30 // assert monthMap.size() == 4
Closure () :
def closureFunction = {a, b -> println a println b } closureFunction(1, 2)
return .
Immutable:
@Immutable class ImmutableClass { String stringVariable Integer integerVariable } def newVariable = new ImmutableClass(stringVariable : "some string", integerVariable : 23)
[]
Groovy (. James Strachan (programmer))[3] 2003 . 2004 2006 . , JCP, , «1.0». «1.0» , 2 2007 . 2007 Groovy 1.1, «1.5» .
Groovy 1.0 2007 , 2009 , Groovy, 2003 (. Martin Odersky) Scala ( 2007 )[4].
JSR-241 2007 (Guillaume Laforge).
[] IDE
Groovy [5], :
- IntelliJ IDEA 7 JetGroovy Plugin;
- Eclipse Groovy Eclipse;
- Netbeans NetBeans IDE.
[] Groovy
iReport, java- JasperReports, Groovy .
Hudson , Groovy.
[] .
- Grails
- Groovy .
[]
- Groovy 1.8.0 final is released (.)
- Groovy 1.8 (.)
- James Strachan. Groovy the birth of a new dynamic language for the Java platform
- Scala as the long term replacement for java/javac? (July 6, 2009). 10 2012. 7 2012. «I can honestly say if someone had shown me the Programming in Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 Id probably have never created Groovy»
- IDE Groovy
[]
| « » | |
| Groovy ? | |
| Groovy ? |
- Home (.). . 14 2012. 5 2006.
- JSR 241: The Groovy Programming Language (.). JSRs: Java Specification Requests. . 14 2012. 5 2006.
- volte, volte Groovy (.). . 14 2012. 18 2008.
- , Groovy : Groovy (19 2006). 14 2012. 26 2006.
- , Groovy (.) (01 2007). 14 2012. 7 2008.
- , Groovy Builders (.) (12 2007). 14 2012. 7 2008.
- , (.) (09 2008). 14 2012. 7 2008.
- , Groovy Java (.) (14 2008). 14 2012. 7 2008.
- , Java Groovy (.) (25 2007). 14 2012. 7 2008.
- , Ant Groovy (.) (21 2008). 14 2012. 7 2008.
- , JDBC Groovy (.) (12 2007). 14 2012. 7 2008.
- , , , Groovy (.) (30 2008). 14 2012. 7 2008.
- , Hierarchical Inherited Rule-Interpreted XML (.) (30 2007). 14 2012. 7 2008.
- , MOP - (.) (06 2008). 14 2012. 7 2008.
- , (.) (04 2008). 14 2012. 7 2008.
- An introduction to Groovy (.). 14 2012. 7 2008.
- Open Directory: Java: Extensions: Groovy (.). 14 2012. 7 2008.
- Groovy for the Office (.). 14 2012. 7 2008.
- Groovy Zone - DZone Groovy news aggregator (.). 14 2012. 7 2008.
- Groovy IDE IntelliJ IDEA
| Java | ||
|---|---|---|
| Sun | ||
| Java | ||


