Archive for July, 2008

Defining Pointcuts


Pointcut nomenclature

Like I said in my post about Core AOP Concepts, Pointcut represent:

An expression that select one or more joint points. In other words, pointcut select joint point that will be advised by an aspect and when the application reaches a join point, advice on that join point may run.

Now, I’ll explain how pointcut actually works and how we can define it.
For the purpose of my post, consider that I use AOP annotations.

Important

Protected and private methods are not intercepted; pointcut will be matched against public methods only!

Pointcut have two important parts that we’ll look in the next points.
[more ...]


 

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 ...]