[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] If and loop pointcuts
|
Hello,
Thank you for all your responses to my question about if statements and
loops.
Sorry it took so long for me to respond to your queries as to why I would
need such a pointcut, but I wanted to finish my technical report about this
so I could provide a link to it for reference.
http://www.sce.carleton.ca/squall/pubs/tech_report/TR_SCE-04-04.pdf
Basically, I use AOP to instrument code to reverse-engineer UML sequence
diagrams from dynamic analysis. Since sequence diagrams contain information
about loops and conditions, I am presently using a script to instrument all
if and loop statements (I add calls to dummy methods for now). This goes
against our goal of separating the target code and the instrumentation code.
Other than this issue, AOP is an ideal solution for our purposes.
If you look at our control flow templates (see report for description), you
see that the information needed is: the statement (similar to the signature
in method pointcuts), the type of loop, the condition, and in the case of a
for loop, the variable (and its initial value) and the increment value. In
our case, we do not wish to alter the loops behaviour, so the required
information can be extracted for the condition statements signature.
However I could imagine a few scenarios, such as measuring performance or
testing, where altering a loops behaviour through aspects can be used to
run a loop many more times than originally coded.
For the curious, the article I was originally referring to is I want my
AOP! Part 2 by Ramnivas Laddad, from JavaWorld.com, page 2: Joinpoints, a
central concept in AspectJ, are well-defined points in a program's
execution. Candidate joinpoints include calls to a method, a conditional
check, a loop's beginning, or an assignment. It goes on to define the
available pointcuts in AspectJ.
Thanks again for all your comments. I am glad that there is a genuine
interest in reasons why ifs and loops are desirable pointcuts, when it
could easily have been dismissed. I hope my research is of interest to you.
Johanne Leduc
_________________________________________________________________
MSN Premium: Up to 11 personalized e-mail addresses and 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines