Skip to main content

Spring AOP vs AspectJ

Considerations

  • Compatibility with project
  • Overhead
  • How quickly can it be integrated
  • Where can it be implemented

Concepts

TermDefinition
AspectStandard / reusable code piece / feature
JoinpointParticular point of execution (method execution, constructor / field assignment)
AdviceAction taken by aspect in specific joinpoint
PointcutRegex that matches joinpoint
Weavingprocess of linking aspects with targeted objects
Advised ObjectGenerated object after weaving

Capabilities and Goals

Spring AOPAspect J
SimpleMore complete (but complicated)
Run-time weavingCompile / Post-Compile / Load-time weaving
Better performance
info

Compile-time weaving: (Source code, aspect) => woven class files

Post-compile (binary) weaving: Weave existing class files

Load-time weaving: Similar to post-compile, only done when loaded into JVM