Announcement Announcement Module
Collapse
No announcement yet.
Mixing proxy based and CGLIB based aspects Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mixing proxy based and CGLIB based aspects

    Hi

    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

  • #2
    You will get CGLIB for all your classes that is what the proxy-target-class implies imho..

    Comment


    • #3
      Ok.
      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.

      Comment


      • #4
        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

        Comment


        • #5
          Ok I'll re-design the web layer using interfaces

          Comment

          Working...
          X