[aosd-discuss] Re: AOP and testing
Laurent Martelli
laurent at bearteam.org
Wed May 14 16:34:26 EDT 2003
>>>>> "Juri" == Juri Memmert <jadawinarc at yahoo.com> writes:
Juri> --- Rickard Ãberg <rickard at dreambean.com> wrote: Hi
Juri> Rickard,
[...]
>> Second, using runtime attributes instead of regular expressions
>> to define pointcuts would minimize the risk of getting pointcut
>> definition problems, since defining runtime attributes is a much
>> more semantically clear way to define what should happen than
>> using method naming conventions.
Juri> I shudder at the "runtime" term... I do not think that
Juri> "compile time" is too early... but regex definitely is
Juri> problematic.
>> This is also how we do it. The pointcut definitions in our system
>> that are regexp either look like this: "set*|add*|remove*" or
>> like this: "create*|clone*|remove|", and we intend to replace
>> them both with "!readonly" and "lifecycle" runtime attribute
>> declarations down the road to avoid any potential problems.
This is sort of what we did in JAC. Regexp can be used, but we also
provide highlevel keywords such as GETTER,SETTER,ADDER,MODIFIER. This
way, pointcuts are often very simple, and they do not rely on a
naming convention. Which methods match the keywords is determined by
some bytecode analysis -- which is not perfect, but works very well
for 99.9% of the cases.
--
Laurent Martelli http://jac.aopsys.com/
laurent at bearteam.org http://www.bearteam.org/~laurent/
More information about the discuss
mailing list