Announcement Announcement Module
Collapse
No announcement yet.
AOP Pointcut Expression Matching Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AOP Pointcut Expression Matching

    Hello,

    I was looking through the AOP documentation and various online examples, but could not figure out the proper declaration of pointcut expressions for beans that implement an interface.

    For example, if i have

    Code:
    package example;
    public interface MyInterface {
    
      public String getString();
    }
    and

    Code:
    package example.impl;
    
    public class MyInterfaceImpl implements MyInterface {
    
      public String getString() {
        return "String";
      }
    }
    would my pointcut expression (in xml) be
    Code:
    execution(* example.MyInterface.*(..))
    or

    Code:
    execution(* example.impl.MyInterfaceImpl.*(..))

  • #2
    I go for option c) None of the above..

    Code:
    execution(* example.MyInterface+.*(..))

    Comment


    • #3
      could you explain why?

      Comment


      • #4
        - Deleted -
        Last edited by Marten Deinum; Aug 26th, 2009, 01:51 PM. Reason: deleted, did not apply

        Comment


        • #5
          I am afraid i do not follow your logic. I was not aware that either of my proposed expression matchers where catching exceptions. I also do not see how your expression would differ from either of mine in regards to catching exceptions.

          Comment


          • #6
            Sorry, mixing up multiple threads, my mistake. (Removed post)

            The + sign indicates all implementations or subclasses (in case of an abstract class) so it is more fitting then just the interface.
            Last edited by Marten Deinum; Aug 26th, 2009, 01:50 PM. Reason: fixed typo...

            Comment


            • #7
              thanks for the explanation

              Comment

              Working...
              X