AspectJ-like languages are currently ineffective at modularizing heterogeneous concerns that are tightly coupled to the source code of the base program, such as logging, invariants, error handling, and optimization. This leads to complicated and fragile pointcuts and large numbers of highly-repetitive and incomprehensible aspects. We propose statement annotations as a robust mechanism for exposing the join points needed by heterogeneous concerns and for enabling declarative fine-grained advising. We propose an extension to Java to support statement annotations and AspectJ's pointcut language to match them. This allows us to implement heterogeneous concerns using a combination of simple and robust aspects and explicit and local annotations. We illustrate this using a logging aspect that logs messages at specific locations in the source code. Statement annotations also simplify advising specific object instances, local variables, and statements. We demonstrate this using an aspect ...
Marc Eaddy, Alfred V. Aho