Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] If pointcut and side effects

> what interest is it to check it if
> one
> > doesn't know when the check is going to happen?

Originally I said that an implementation of AspectJ is free to reschedule
if-PCD evaluation if it could do so correctly.

I agree that it wouldn't be correct to evaluate an if-PCD statement
before starting the join point if the statement relied on a variable that
the program thread can change.*  Further, I think there's some argument that,
e.g., more-precedent before advice should be able to set the variable and
have the change be visible when evaluating the pointcut for less-precedent
advice.  That's a policy point we could and perhaps should say.
However, since we've said the if-PCD evaluation itself should be free of 
side-effects, you shouldn't rely on setting the variable in an if-PCD
evaluation for the more-precedent before advice.

For an example of studied indeterminacy, see Java thread priorities,
made expressly unreliable to support different platform.  In that
case, the programmer has tools to ensure sequencing (namely, variations
on locks) so it's just a question of how the program is written, not
whether it can be written at all.  This situation with AspectJ if-PCD
evaluation is the same: there are other ways to write the same thing
(and I would argue the other ways are much more clear).

Wes


> ------------Original Message------------
> From: "Eric Bodden" <eric.bodden@xxxxxxxxxxxxxx>
> To: aspectj-users@xxxxxxxxxxx
> Date: Thu, Jun-22-2006 3:39 AM
> Subject: RE: [aspectj-users] If pointcut and side effects
>
> > If barely anything can be said about when an if pointcut is 
> evaluated,
> > how can it be useful? A variable is assigned somewhere along the
> > execution of the program, but of what interest is it to check it if
> one
> > doesn't know when the check is going to happen?
> 
> What is well-defined is that it will be evaluate at any joinpoint which
> matches the rest of the pointcut. What is not defined is the *relative*
> order of if-pointcuts which are part of one and the same pointcut.
> 
> Eric
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 



Back to the top