Results 1 to 5 of 5

Thread: Mixing proxy based and CGLIB based aspects

  1. #1
    Join Date
    Jun 2008
    Location
    Madrid
    Posts
    12

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    You will get CGLIB for all your classes that is what the proxy-target-class implies imho..
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jun 2008
    Location
    Madrid
    Posts
    12

    Default

    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.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    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
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Jun 2008
    Location
    Madrid
    Posts
    12

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •