Groovy, The Red Pill: Or How to Blow the Mind of a Buttoned-down Java
Scott Davis
This talk focuses on the ways that Groovy can turn a traditional Java developer's world-view upside down. We'll start by talking about how you can thumb your nose at The Man by leaving out many of the main syntactic hallmarks of Java: semicolons, parentheses, return statements, type declarations (aka duck-typing), even try/catch blocks. Of course, there's no way that we'd leave metaprogramming out of the discussion... What is metaprogramming? We'll add new methods to classes at runtime -- even if they were originally implemented in Java; even if they were declared final. (Thanks, ExpandoMetaClass!) We'll call methods that don't exist and avoid the dreaded MethodNotFound Exception. (Thanks, invokeMethod!) We'll narrowly scope our metaprogramming shenanigans using Use blocks and Categories, and then cast our changes to the wind such that every instance of a class gets our added juice.
|