Spring AOP - why do i need aspectjweaver? Spring AOP - why do i need aspectjweaver? spring spring

Spring AOP - why do i need aspectjweaver?


Spring AOP implementation I think is reusing some classes from the aspectj-weaver. It still uses dynamic proxies - doesn't do byte code modification.

The following comment from the spring forum might clarify.

Spring isn't using the AspectJ weaver in this case. It is simply reusing some of the classes from aspectjweaver.jar.

-Ramnivas


You are using AspectJ style pointcut-expression @Aspect and @Before are part of AspectJ. Check this link.

Regarding the AspectJ-weaver, its actually a bytecode weaver which weaves aspects into classes at load time.


I recently had a similar question Why does spring throw an aspectj error if it does not depend on aspectj?

To use Spring AoP without an AspectJ dependency it must be done in xml. The annotations are a part of AspectJ.

Also, the really cool expression language is only supported by AspectJ. So you have to define explicit point-cuts. See Section 6.3.2. Declaring a pointcut:http://static.springsource.org/spring/docs/2.0.x/reference/aop.html section

I'm still having trouble finding any elaborate documentation on this technique.