1.

Compare Spring AOP vs AspectJ?

Answer»

Think about Spring AOP and AspectJ over various pivot – for example, capabilities, goals, weaving, INTERNAL structure, joinpoints, and simplicity.

  • Capabilities and Goals

Spring AOP means to give a basic AOP execution crosswise over Spring IoC to take care of the most widely recognized issues that software engineers face. It isn't proposed as a total AOP arrangement – it can only be applied to beans that are managed by a Spring container.

Then again, AspectJ is the original AOP technology which means to give complete AOP SOLUTION. It is more robust yet in addition altogether more COMPLICATED than Spring AOP. It's additionally important that AspectJ can be connected over all the domain objects

  • Weaving

Both AspectJ and Spring AOP utilizes the diverse kinds of weaving which influence their behaviour in regards to execution and convenience. AspectJ makes use of three different types of weaving:

  1. Compile-time weaving: The AspectJ compiler takes as info both the source code of our aspect and our application and produces a woven class file as yield
  2. Post-compile weaving: This is otherwise CALLED binary weaving. It is utilized to weave existing class files and JAR files with our aspects
  3. Load-time weaving: This is actually similar to the previous binary weaving, with a distinction that weaving is deferred until a class loader LOADS the class files to the JVM
  4. As AspectJ utilizes compile time and classload time weaving, Spring AOP makes utilization of runtime weaving.

With runtime weaving, the aspects are woven amid the execution of the application utilizing proxies of the targeted object – utilizing either JDK dynamic proxy or a CGLIB proxy



Discussion

No Comment Found