Archive for the 'AOP' Category

AOP Weaving


What is AOP Weaving?

It’s the process of inserting aspects logic into the application code at a specific jointpoint.

  • Compile time weaving
  • Runtime weaving

What about Spring AOP!!

Spring AOP use Runtime weaving and is based on proxies. Spring can generate two kind of proxy:

  • JDK Dynamic Proxy (java.lang.reflect.Proxy)
  • CGLIB proxy

[more ...]


 

Core AOP Concepts


With new technology comes new terminology to describe the technology and what can be done with it.

I will define some key AOP concepts to give you a good comprehension that will help you all along my future articles on this subject. However these terms are not Spring specific and really belong to AOP.

Jointpoint
  • Well-defined point in the execution of an application
  • The point where you can insert additional logic to be execute
  • Examples of Jointpoint’s
    • Method invocation
    • Exception being thrown
    • Field modification

In Spring AOP a jointpoint always represents a method execution.
[more ...]


 

What Problem Does AOP Solve?


OO applications can be seen as being built on top of a collection of classes. Each of these classes has a particular purpose, with responsibilities that are clearly defined. Those classes collaborates to achieve the application’s overall goal.

However, generic functionalities like logging, security or even transactions are often needed in many places in the application. We can state that those functionalities cross-cut the application, and impact a lot of classes.
[more ...]