Greach 2014

Metaprogramming with Groovy

Groovy is a dynamic language that provides different types of metaprogramming techniques. In this talk we’ll mainly see runtime metaprogramming. I’ll explain Groovy Meta-Object-Protocol (MOP), the metaclass, how to intercept method calls, how to deal with method missing and property missing, the use of mixins and categories. All of these topics will be explained with examples in order to understand them.
Also, I’ll talk a little bit about compile-time metaprogramming with AST Transformations. AST Transformations provide a wonderful way of manipulating code at compile time via modifications of the Abstract Syntax Tree. We’ll see a basic but powerful example of what we can do with AST transformations.

Source code:

Engineer at Kaleidos

Iván Lopez

Iván López

Software Engineer and Systems Administrator with 11 years of experience. I discovered Grails 4 years ago and since then I develop almost exclusively using Groovy. I am the creator of and some Grails plugins like Postgresql-Extensions and Slug-Generator.

Everyday, I look forward to learning and enjoying at my job. I think I qualify for the “Geek Dad” definition and so I share my passion for technology and free software with my two daughters. You can contact me at the monthly meetings of Madrid-GUG or on twitter via @ilopmar.