Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] How to provide external pcd definition?

> From: Adrian Colyer
> 
> or, possibility b)
> 
> public class AspectJElementFactory {
> 
>   public static Pointcut createPointcut(String pointcutExpression);
> 
> }
> 
> public interface Pointcut {
> 
>   public boolean matches(JoinPoint jp);
> 
> }
> 
> I think I'm leaning towards possibility b, because I like the 
> notion of 
> Pointcut being an interface (even though possibility (a) is 
> closer to the 
> java.lang.reflect design) - it allows for example a separate 
> implementation for a Pointcut obtained via reflection (as 
> below), 

There's another reason to like b, which is that different pointcuts
might be implemented by different classes. You can do that with a
too I guess, but it seems cleaner with b.

You might want to make matches return some environment structure
rather than boolean right away, because you're going to want that
real soon I think.



Back to the top