The Unbearable Lightness of Java

Proxetta proxetta logo

Proxetta creates dynamic proxies in run-time, providing efficient support for aspects.

A proxy class is a class that wraps or extends target class specified at runtime. Proxy Aspect contains advice and pointcut rules for applying advice. Proxy Advice is the code portion of an aspect, i.e. the logic that replaces crosscutting concern. Pointcut is a set of points in the application where advice should be applied, i.e. which methods will be wrapped by proxy.

Proxetta has dependency on ASM v3.2 library (included with the bundle).

Reasons why

What is unique is the way how pointcuts and advices are defined.

Proxetta pointcuts are defined in pure Java, no custom proprietary notation is used. Therefore, any matching mechanism may be used: regular expression, wildcards; configuration might be stored in external (XML) files and so on.

Proxetta advices uses completely different concept than any other AOP library. Advices are written in the same way as user would write real subclass. Instead of using custom class for accessing proxified method and its arguments, they will be replaced directly on the usage place.

This approach makes Proxetta fast. Very fast.

Performance test

Because of its unique approach for advices definition, Proxetta is very fast. Compared to one of the most used code generation libraries, CGLIB (used by dynaop), invocation of proxified method is almost 80% faster.

Proxetta performance test