Spring as a AOP Framework
AOP – Aspect-Oriented Programming is a technology well designed to solve many common problems that programmers encounter on their way to make a good, working code in J2EE. Spring offers AOP technology to complement IoC feature and confirm that the enterprise services codes are not polluting your application codes.
To keep everything in Spring architecture design, its AOP features are separated form core IoC container. You don’t have to use AOP technology with Spring, but most of the users choose to keep using it within Spring, only to use full potential of “out-of-the-box” services provided by framework.| more |
As written at the upper sections of this article, the key to AOP framework is providing a different way of thinking about application structure.
This structural thinking is captured in the form of pointcuts. Pointcuts are determining which joinpoints a piece of advice should apply to. It's more logical — although not fully accurate - to think of a pointcut as a set of joinpoints: for example, a set of methods that might be targeted by an advice.
Pointcuts are identifying where the advice should be applied to.| more |
In order to put pointcuts and advice together, we need an object that contains both: that is, containing the (advice) and (pointcut).
Spring introduces the concept of an Advisor: an object that includes both advice and a pointcut specifying where that advice should be applied to. When advice and pointcutare only by them selfs, an Advisor is not an established AOP concept, but a Spring-specific term.
The purpose of Advisor is to allow advice and pointcut to be reusable separatly
If an advice is used without a pointcut, a pointcut will be created that will match the advice. Spring uses the standard instance pointcut. TRUE in this case. | more |