6 Using aspects with Spring AOP

 

This chapter covers

  • What aspect-oriented programming (AOP) is
  • Using aspects
  • Using the aspect execution chain

Up to now, we discussed the Spring context, and the only Spring capability we used was dependency injection (DI). Dependency Injection is a technique supported by the Inversion-of-Control (IoC) principle. With dependency injection, the framework manages objects you define, and you can request to use these objects where you need them. As we discussed in chapters 2 through 5, to request a bean's reference, you use, in most cases, the @Autowired annotation. When you request such an object from the Spring context, we say that Spring “injects” the object where you requested it. In this context, “Spring injects the object” is equivalent to “Spring provides an object”. In this chapter, you’ll learn how to use another powerful technique supported by the IoC principle: aspects.

6.1      How aspects work in Spring

 
 

6.2      Implementing aspects with Spring AOP

 

6.2.1   Implementing a simple aspect

 

6.2.2   Altering the intercepted method’s parameters and the returned value

 

6.2.3   Intercepting annotated methods

 
 

6.2.4   Other advice annotations you can use

 
 

6.3      The aspect execution chain

 
 
 
 

6.4      Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest