Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ vs PostSharp?

Oh, I would want AspectJ to be a kitchen sink. I like it as it is. 

My previous post had too many words, most of them irrelevant to what I am
really looking for in this backdoor. 

There are advices and there are pointcuts. Pointcuts are declared using a
certain syntax. In an ideal world, nothing else is needed. But in reality,
there are things that one cannot express using the current pointcut syntax. 

For instance, I would like to declare a pointcut that matches any method
with only the primitive parameters. The current syntax does not allow me to
do so, does it? I can write something like this:

pointcut aaa() : execution(* *.*((int || double || char), (int || double ||
char), (int || double || char), ..)); 

But I need to list all the primitive types and create several versions of
this pointcut for methods with 0, 1, 2, 3, etc arguments until some
reasonable number.

In an ideal world AspectJ would have a syntax to describe this pointcut, but
there is none currently. My backdoor allows to workaround this limitation,
by having something like this:

pointcut aaa() : MyExecutionPointCut(); 

ExecutionPointCut MyExecutionPointCut() {
  // Here comes the Java code constructing the ExecutionPointCut object
describing exactly what I am looking for. This code has access to everything
that is known at the compile time.
}

Does it make more sense now?

--
View this message in context: http://aspectj.2085585.n4.nabble.com/AspectJ-vs-PostSharp-tp4196604p4197102.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top