Would like to know what is the best practice and why on the following scenarion.
Should pointcut be applied on interface, or abstract class or on the concrete class?
Interface1 is an interface which holds all the business methods.
Abstract1 is an abstract class because it does not implement all the methods in Intefrace1. Abstract1 does not have any abstract method.Code:Abstract1 implements Interface1
Concrete1 is a concrete class that implements all the methods of Interface1.Code:Concrete1 extends Abstract1
In reality, I could apply point-cut on the methods of Interface1. In that way, I do not have to specify in pointcut on the methods of the concrete classes (e.g. Concrete1, Concrete2). Interface could also reside in another project (e.g. Core project). Concrete1, Concrete2 classes could be in separate projects (e.g. proj1, proj2) that includes Core project.
I may not be able to apply pointcut on Abstract1 (even on non abstract methods of Abstract1), as it does not have all the methods that I need.
Only Interface1 and Concrete1, Concrete2 etc. have all the methods that I need on which I could apply pointcuts.
From my reading, it is recommended that I apply pointcut on the concrete classes over Interface, or on abstract class because of proxy etc.
What ara the implications of applying pointcut on Interface, as opposed to Concrete class (or, Abstract class)?


Reply With Quote
