Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] If and loop pointcuts



Hello,

While how to implement if and loop pointcuts is challenging and interesting
as research aspects, I do not think we want an aspect for each and every
single language statement/entity.

The so called AOP supposed to address crosscut issues with in a system.
What a crosscut issue can we identify for all loops in a system?  Yes, of
cause we should have loop invariant for each loop, but I do not think that
can be done in a general loop aspect.

Or one may say, we do not want address all loops but a specific loop in a
specific method, then why use AOP rather than conventional coding practice?

It might be useful for tracing a specific problem in a known loop, but do
we really want invent a pointcut for each possible special case and loss
our focus on crosscut issue that AOP suppose to address?

Regards,

Bo
----------------------------------------------------------
  Dr. Bo Yi
  WAS L3 Support
  IBM Toronto Lab
  A2-713/Q2Z/8200/MKM
  8200 Warden Ave. Markham ONT. L6G 1C7
  Phone: 905-413-4819
  Tie Line: 969-4819
  E-Mail: boyi@xxxxxxxxxx



                                                                                                                                                      
                      Bruno Harbulot                                                                                                                  
                      <bruno.harbulot@cs.m        To:       aspectj-users@xxxxxxxxxxx                                                                 
                      an.ac.uk>                   cc:                                                                                                 
                      Sent by:                    Subject:  Re: [aspectj-users] If and loop pointcuts                                                 
                      aspectj-users-admin@                                                                                                            
                      eclipse.org                                                                                                                     
                                                                                                                                                      
                                                                                                                                                      
                      04/20/2004 10:02 AM                                                                                                             
                      Please respond to                                                                                                               
                      aspectj-users                                                                                                                   
                                                                                                                                                      



Hello,

I agree with Gregor about the problem of having pointcuts that could
identify specific loops, which have no names.

Moreover, as I said at AOSD 2004, a for-loop pointcut would also be a
big change in AspectJ (both language and compiler). One could imagine a
for-loop pointcut of the form "for (<init> ; <condition> ; <increment>)"
with the equivalent of an "arg" construct to get the 3 parts, and
something like "proceed()" to execute the loop-body.
For parallelisation (and presumably for other applications), an
interesting for-loop pointcut would be able to "reconstruct" the
iteration space. However, these 3 parts are not objects nor values (as
they picked up by "arg"), but instructions. There is no constraint on
their semantics. Usually, a for-loop would be written as "for ( VAR =
MIN ; VAR <= MAX ; VAR += STRIDE)", and it would be interesting to have
a pointcut that picks out MIN, MAX, STRIDE and VAR. But not all the
loops follow this form, and analysing the code to predict something
compliant with this form (when possible) would be quite a big change to
AspectJ's pointcut mechanisms.


Bruno.

(I didn't see the Virigina examples, so I can't comment on them.)


Gregor Kiczales wrote:
> At the AOSD conference, Kevin Sullivan was demoing some work by a
> student from University of Virginia, showing a good use of if and
> loop join points. Was that the paper you were reading?
>
> At the time we finalized the join points for AspectJ 1.0, we had
> never seen reasonable uses of such join points. But the application
> shown at AOSD shows that there is at least one such use.
>
> As usual, the key issue is to have pointcuts that pick them out in
> reasonable ways, rather than by fragile properties such as "1st if
> in the method named foo". The examples I saw at AOSD picked in
> terms of which direction the branch takes (true/false). They used
> this to do code coverage.
>
> I bet that if more reasonable uses show up, these join points and
> pointcuts could make it into a future version of AspectJ. But, as
> nice as the Virginia examples are, it would be good to seem some
> more before doing this.
>
> But since AspectJ is open source, its an easy thing for someone
> to try.
>
>
>>-----Original Message-----
>>From: aspectj-users-admin@xxxxxxxxxxx
>>[mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of Johanne Leduc
>>Sent: Friday, April 16, 2004 12:34 PM
>>To: aspectj-users@xxxxxxxxxxx
>>Subject: [aspectj-users] If and loop pointcuts
>>
>>
>>Hello,
>>
>>I read an article on AOP and AspectJ that mentioned, when
>>explaining AOP
>>principles, that the beginning of a loop is a possible
>>joinpoint. I know
>>it's not presently an AspectJ feature, but I was wondering if
>>there are
>>plans to one day have "if" statements and loops as pointcuts.
>>I'd really
>>appreciate any thoughts on this.
>>
>>Thank you,
>>Johanne
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top