Subject: Re: Review and HW4 Part3 redo...
From: Paul Freeman (pfreeman@ccs.neu.edu)
Date: Fri Oct 25 2002 - 18:40:43 EDT
Rado -
>I generate a file according to the user's
>input, this file contains the corresponding pointcut.
>
This is a great approach but unecessary and I think will take too long
for most of you to fully implement.
>I don't see a way to
>construct a pointcut with a variable name in it.
>
You can't pass a variable to a pointcut or pass pointcuts or join
points to advice as arguments. It must all be predefined. You should
take the approach of having named pointcuts in the program. Then allow
the user to modify the join points in the pointcut by modifying, for
example, the Any class where the pointcut exists.
>We saw your approach
>doesn't generate files but i didn't undestand where
>the
>'testcase' in your pointcut definition comes from. Can you please clarify
>this.
>
testcase is the name of the package that all of my test classes exist in.
>Did you post somewhere what we saw yesterday ?
>
I think this is close to what was shown yesterday.
NOTE: what is shown here will not work correctly! However it is an
example of something that is close to what could work for you. As was
mentioned yesterday, the ToAvoid pointcut is wrong. It can't include
GlobalPreferred.
**************
//Modify the pointcuts below to exclude join points from being checked
by the application
// denotes classes to avoid checking
pointcut ToAvoid(): !Stable() && !GlobalPreferred();
// NOTE: With the following pointcuts, to nullify the pointcut, i.e.
// have it pick out no join points, use:
// Nothing()
// as the sole designation
// denotes all globally preferred static members
pointcut GlobalPreferred(): AllStaticAccesses();
// denotes stable classes calls to which should not be checked;
// multiple pointcuts should be separated with ||
pointcut Stable(): AllJavaPackageAccesses() ;
//
// what follows is a series of usefull predefined pointcuts
//
// denotes the opposite of all classes
// !within(*) can be read as not within any package.
// It can be used to represent the empty set
private pointcut Nothing(): !within(*);
//denotes all statically accessed immediate parts and methods
private pointcut AllStaticAccesses(): scope() &&
call(static * *.*(..)) ||
get(static * *);
private pointcut AllJavaPackageAccesses(): scope() &&
call(* java..*(..)) ||
get(java..* *);
***************
>By the way your reply-to field in your e-mails gives different address
>from the one you are sending from. Which one do you want us to use or it
>doesn't matter?
>
It doesn't matter, they both go to my home address.
Paul
>
>
>thanks
>rado
>
>
>On Fri, 25 Oct 2002, Paul Freeman wrote:
>
>>Hi Class -
>>
>>If anyone who turned in HW4 wants to modify their solution to part 3
>>after seeing the portion of the solution that was shown in class last
>>night, please send me an email letting me know. If you do not send me
>>an email and have turned in the assignment, I will assume you are
>>satisfied and will email you a solution tonight.
>>
>>I have not had a chance to look over the solutions I have so I do not
>>know how any of you approached the problem. It is not necessary that
>>you use the same approach I did, however I will be taking points off if
>>you did not allow for, i.e. provide instructions/facilitate, easy
>>modification of what is considered either GloballyPreferred or Stable by
>>the user. If you misunderstood the problem as being one of avoiding
>>globally preferred methods instead of collecting the objects returned by
>>them, I will not take off if your code does this correctly. ALL future
>>submissions must collect and treat the globally preferred objects as you
>>would a return value, i.e. I will take off points if any future
>>submissions do not do this.
>>
>>I only have 8 HW3's from students (out of about 25), two of which did
>>not complete part 3. Please get your solutions to me ASAP. I will
>>again not be around as much this weekend so after today, you may not get
>>a solution till early next week.
>>
>>If any of you have questions or would like to have a review session, I
>>would be willing to do so on Monday. I have class from 6 - 9 Monday
>>night. I would be happy to hold it for an hour or so before and/or
>>after class. A lot of you are having problems with some of the
>>concepts... but only one of you has approached me asking for specific
>>help. I have been pretty lenient when grading the homeworks. I am
>>afraid that some of you may do poorly on the midterm unless you ask for
>>a little help. I'm sure Karl would be happy to see you during his
>>office hours if you either can't or don't want to talk to me.
>>
>>Paul
>>
>>
>
>
This archive was generated by hypermail 2b28 : Fri Oct 25 2002 - 18:43:42 EDT