Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: AW: [aspectj-users] Using AJ to change program flow

 
> Ron Bodkin said:
>
> It's better to think about join points as points in a running 
> program, rather than thinking about text manipulation.

Ron's right about this of course.  (and see below)

> > Jim Carrol said:
> > 
> > Thanks for the response. I'm surprised about this. It seems that it 
> > should work either way depending on how you pick out of the join
> > points. 
> >
> > If the join points are 'calls' then the the parameter evaluation should
> > not execute. If the join point is 'execution' then I would expect it 
> > to. I think this because I visualize what is taking place as the 
> > insertion of code into the original source. I see the code inserted where
> > a 'call' is made when the 'call' join points are selected but I see it as 
> > inserting code into the method where 'execution' is used.
> > ...

One problem with the semantics you desribe is that it is 'fragile' and
doesn't scale very well. By fragile I mean that its very vulnerable to
small, otherwise trivial changes to the source code. For example, most
programmers feel that if they take code like:

   foo(a + b + c());

and change it to:

   String temp = a + b + c();
   foo(temp);

then the code has the same effect. But if call join points had the semantics
you describe, then these two could be different, in a way that we felt was
surprising. That's one reason we designed the language the way we did. Our
goal was to expose meaningful and stable join points in the program execution.





Back to the top