1

I´m learning Spring AOP and I saw this table with differences between Spring AOP and AspectJ.

Joinpoint            Spring AOP Supported   AspectJ Supported
Method Call               No                  Yes
Method Execution          Yes                 Yes

What´s the difference between method call and method execution?

Goldbones
  • 1,407
  • 3
  • 21
  • 55
  • 1
    Possible duplicate of [execution Vs. call Join point](https://stackoverflow.com/questions/18132822/execution-vs-call-join-point) – ETO Nov 06 '18 at 18:22

1 Answers1

0

There are different kind of join points:

  • Method invocation
  • Method execution
  • Object creation
  • Constructor executions
  • Field references

Spring AOP supports only public method invocation, for other's you would need AspectJ. method invocation (method call) allows you to target it during the call BUT BEFORE the actual execution. So you can't place the joinpoint in the middle of method being executed - only before or after or around in Spring AOP.

AspectJ allows for more possibilities, but is also seen as more complicated, however is more efficient performance wise due to compile time weaving (Spring AOP is runtime). So if you need more capabilities/better performance you are better off with AspectJ however that is rarely the case as Spring AOP is enough for most cases.

Here is a little overview of Spring AOP in case you want to learn more. https://javamondays.com/spring-aop-beginners-guide/

J Asgarov
  • 2,526
  • 1
  • 8
  • 18