First groovy experiences
Currently I’m staying at copenhagen at the GR8Conf (Grooy, Grails and Griffon confernence). In the talk of the day by Guillaume Laforge about DSLs he showed the following code:
class CurrencyAmount {
Number amount
String currency
String toString() { "$amount $currency" }
}
Number.metaClass.getEuros {->
new CurrencyAmount(amount:delegate, currency:"EUR")}
10.euros
//Output: 10 EUR
It is really interesting to see where in the java world the language evolvement happend. It’s a bit similiar (I’m careful here, because I do not know groovy very well) to the extension methods in .Net.
For me groovy and grails are very interesting technologies, so I will stay up to date.
Related posts:
Categories: Groovy





More post please! you are leaving a poor old man hungry for more :[