Go to content

Sean Floyd - Hacking Java

Code Generation, Policy Enforcement and Byte Code Manipulation. Enhancing Java at build, compile and runtime. You know Java—but do you really know Java? As a Java engineer for the last 18 years, I continue to be amazed by how much one can do with this powerful yet sometimes-annoying language. As we all know, Java is very verbose. Sometimes this verbosity is a good thing, but sometimes you just wished you could simplify things a lot. In this talk, I want to share a collection of hacks that I’ve picked up over the years that have saved me time and anguish. Whether you’re looking to do meta programming or static code analysis, address cross-cutting concerns, add language features, or simply reduce boilerplate, I will show you some tricks you can use to get the job done. I’ll also explore annotation processing, dynamic proxying, compiler plugins and several other powerful mechanisms that will empower you to go beyond what plain Java can do. These tips and topics are usually not taught, at least not in one place—only by their respective communities. What they have in common is that they can help you to avoid repetitive work, potential runtime problems at build time, and/or implementing the same (or almost the same, which is worse) code in separate places. With great power comes great responsibility, so I’ll also go into how much of this is actually a good idea and why.

February 29, 2016