Pra quem sempre quis saber que diabos é esse tal de AOP (Aspect-Oriented Programming), vai aí uma boa dica: saiu hoje a versão nova do AspectWerkz, um framework de AOP que é extremamente fácil de usar, e bastante flexível, sem cometer alguns dos “erros” de usabilidade do AspectJ (o framework de AOP mais famoso no mundo Java).
O AspectWerkz tem, além do que já era de se esperar num framework de AOP (aspects, advices, pointcuts, join points e introductions), features muito bacanas, como persistência 100% transparente, adição de meta-dados e UUIDs para qualquer classe na VM, exceto as do rt.jar (é uma pena, mas não dá pra fuçar com as collections, ainda ;)).
Aqui vai a lista de features:
Runtime bytecode modification (using BCEL). Hooks in and transforms classes loaded by any class loader except the bootstrap class loader (using JMangler). Which basically means that you can easily transform any (legacy) application or external library apart from rt.jar both in runtime or during a compilation phase.
The join point model supports interception of fields and methods, public, private, protected, and package protected, static and class members. It also supports exception interception.
Introductions (Mixins/Open Classes), i.e. the possibility to add interfaces, methods and fields to existing classes.
Transparent persistence for both advices and introductions (using Prevayler ).
Four different deployment models (scope) for both advices and introductions: perJVM (singleton), perClass, perInstance and perThread.
Hot deployment, advices and introductions can be dynamically deployed, undeployed or rearranged (without reloading or retransforming the target classes).
High-performant, an Introduction or Advice adds an overhead of ~0.0005 ms/call.
Meta-data additions to classes. Possibilities to add meta-data to all loaded classes.
Regular expressions for selecting the pointcuts.
Uses the same semantics as AspectJ. I.e. aspects, advices, pointcuts, join points and introductions.
“Offline” transformation (can be used as a post-processor).
Aspects, advices and introductions are written in plain old Java code. I.e. no new language to learn, no new compilation phases, no need to tell your manager
The target classes can be regular POJOs (Plain Old Java Objects), i.e. do not need to have an interface.
External configuration using an XML config file.
Simple usage and configuration.
Site oficial: AspectWerkz