Take the 2-minute tour ×

I need quick answer to a simple thing in AOP.

If i have a code deployed at client side and i have written new aspects, which i want in the client side software. do i have to "recompile" complete software with "original" code and new "AOP" code? (with aop compiler)?

i.e. do i need the source code of original program with source code of new AOP and compile 'em both?

P.S: I am asking in general, not being specific to any language. However, if the answer must be language-specific, let's say Java and AspectJ as the AOP framework.

share|improve this question
Your question needs to be language specific, since the answer is going to be different in every case. Sometimes AOP is compile-time, sometimes it's runtime. –  skaffman Jun 5 '10 at 22:30
Just in Java there are different compilers that will do runtime as well as compile-time. –  Romain Hippeau Jun 6 '10 at 2:16
okay lets go with java and runtime thing. could you guide me for that. My foremost point of interest is that i have already deployed the code at client side and I don't want to re-compile the whole code. Would deploying new aspect can intercept in already deployed code? i.e. some kind a hooks that i can generate using VM or something like that? –  x.509 Jun 6 '10 at 23:03
add comment

1 Answer

You want to check out AspectJ LTW (load-time weaving).

P.S.: I am assuming that your clients are willing to deploy your aspect code (e.g. in a separate JAR) and start up the JVM in a slightly different way so as to activate LTW. Then the answer is yes, it is possible.

P.P.S.: AspectJ can even recompile your class files and do binary aspect weaving without you needing to have the source code. This way you could replace the client code by an aspect-woven version. That way the JVM could be started just like before, just the client library in question needs to be replaced.

share|improve this answer
add comment

Your Answer


