Say Service calls Dao class on which logging aspect(annotational) needs to be applied. I am wondering how aspects actually gets applied.
As per my understanding at the time of DAO injection under Service object, spring finds out that there is some aspect(in this case logging) is configured for DAO, so it injects the proxy object instead of actual target object. Now when actual call is made to any method inside DAO, proxy applies the aspects and then call the actual target object. Is that correct ? Also i believe this is called Run time weaving.
On the other hand same can be done with load time weaving(with javaagent configuration) where byte code manipulation is done for classes on which aspects needs to be applied. So proxy does not come into picture here.
Please correct me if i am wrong as this is the foundation for all spring modules?