Summary

In this chapter, we learned one of the important ways to achieve separation of concerns called AOP. Conceptually, we are removing the dependency of cross-cutting concerns from business code and applying them with plug-and -play fashion and in a more controlled way with AOP. It solves the design problem that we never could resolve with the traditional AOP model. 

We understood the need of AOP by taking an example where we need to keep changing business code when common functionality is changed. We have also seen various terminologies used in AOP, which is very crucial to understanding underlying concepts.

Soon after learning the theory of AOP, we started our journey with Spring AOP to understand the practical concepts. First, we learned to define AOP configuration in an XML file, followed by declaring various artifacts such as aspect, point-cut, and advice. Details about point-cut expressions and advice types were shown with various examples and code samples. 

Next, we learned how to define Spring AOP configuration with the @AspectJ annotation style, followed by declaring aspects, advice, and point-cuts with annotation. We also learned how to define an advisor by implementing various interfaces. Lastly, we saw the benefits and limitations of Spring AOP and the AspectJ framework, followed by how to choose the configuration style for Spring AOP: XML or annotation. 

We will move on to learn various design patterns that you can use to achieve IoC, and what the best practices, patterns, and anti-patterns are while working with dependency injection in the next chapter. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.151.164