Feb 27th, 2009, 03:19 AM
Mixing proxy based and CGLIB based aspects
I'm introducing some aspects in an existing layered web application. DAO and service layers are defined by interfaces, but my JSF web layer is class based.
I would like to use <aop:aspectj-autoproxy /> to detect my aspects My question is: if i use <aop:aspectj-autoproxy proxy-target-class="true" />, I will get proxy based aspects for interfaces and CGLIB aspects for concrete classes or I will get CGLIB based aspects for all my classes?
Suggestions will be welcome
Feb 27th, 2009, 06:13 AM
You will get CGLIB for all your classes that is what the proxy-target-class implies imho..
Feb 27th, 2009, 07:21 AM
Is there any significant performance difference between both aproaches? I'm asking because if proxy-based AOP has any clear advantage, I'd probably consider declaring interfaces for my web layer.
Feb 27th, 2009, 07:31 AM
It is simpler, follows best practices (interface based programming), you can make classes final (you cannot do this with cglib). Just to name a few
Feb 27th, 2009, 01:09 PM
Ok I'll re-design the web layer using interfaces
Tags for this Thread