[aosd-discuss] can you have interception w/o aop?

Eric Bodden eric.bodden at mail.mcgill.ca
Wed Apr 5 08:08:45 EST 2006


Hi Roger.

Depends on whether with whatever technique you choose you achive to
implement the crosscut in a modular way, I would say.

> if we make a static factory that subclasses and inject 
> logging code into every method or specific named methods , is 
> it still aop or just interception?

Well, this would involve _copying_ all the methods on the superclass(es)
and tweaking them in such a way that they do logging, right? (Or I got
your proposal wrong.) Well, copying code can certainly not be seen as a
way of implementing crosscutting features in a modular way because in
your subclass the code would still be excessivly scattered. You would
not have gained anything.
  
> if you inject logging code and say "hey i can inject this in 
> whatever i want and i think that my logger is an aspect" 
> would that be considered aop?

See again above - does not depend on the way how you inject it but what
you achive, really.

> and when is a pointcut a pointcut?
> if i express it as dsl , or if i express it as static c# "if 
> (method.Name.StartsWith("set_")" , is that a pointcut?

I would say that the following definition is reasonably precise: "A
pointcut is a predicate over the statis structure or dynamic behavior of
a program." Again, this does not depend on the way how you define this
predicate at all.

At the DOAL workshop at AOSD this year we had a discussion about
"library based approaches" to AOP vs. approaches facilitating "language
extensions". Gergor raised the (IMHO valid) point that any library can
in fact also be seen as a special constraint way of a language
extension, because in fatc it also comes with its own syntax (even
though within certain constraints of a base language) and semantics. So
from this point of view, the notion of an aspect/pointcut/advice is
really language independent.

Eric

--
Eric Bodden
Sable Research Group, McGill University
Montreal, Canada 



More information about the discuss mailing list