Spring AOP versus AspectJ language

In this chapter, we mainly looked at Spring AOP. AspectJ is another solution to implement AOP; however, Spring AOP is simpler than AspectJ because it doesn't require you to introduce an AspectJ compiler or weaver into your development and build process. 

Spring AOP has been introduced to provide a simple AOP implementation throughout the IoC container to solve generic problems, while AspectJ is a full featured AOP framework. AspectJ is powerful in nature, but more complex than Spring AOP. AspectJ supports compile-time, post-compile-time, and runtime weaving, while Spring AOP only supports runtime weaving through a proxy. 

If your business needs advice on the set of operations of the Spring bean project, Spring AOP is the right choice for you. If you come across a requirement where you need to intercept and implement advice on objects not managed by the Spring container, you should go with the AspectJ programming framework.

Spring AOP supports method-level join-points only. If you need any advice on join-points other than methods (such as field, setter, or getter methods), you should consider AspectJ. Another point you should consider while choosing from these frameworks is performance. Spring AOP uses a proxy, so there should be little runtime overhead. Compared to Spring AOP, there is less overhead while working with AspectJ.

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

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