Java - Why does aspectj require installation of a plugin?

advertisements

So I am trying to use AOP in my application for logging and some error handling. Most people recommended using aspectj, so my question is why does aspectj require me to install an eclipse plugin to be able to use it? Doesn't aspectj simply use reflection to modify classes at run-time?

We are also using a build server , do I need to install anything on the build server as well in order to run a project using aspectj?


It doesn't, unless you specifically want to have Eclipse be aspect-aware, and include AspectJ functionality in its internal build process. (IMO IDE support for AOP is awesome, and makes AOP much easier to deal with. the gutter markings alone are worth the price of admission.)

AspectJ modifies byte-code; you cannot do what it does through pure reflection,

Your build server needs the appropriate libraries. If you're doing compile-time weaving, that needs to be added to the build script.