Re: can you have interception w/o aop?

"Roger Johansson" <[email protected]>
Newsgroups gmane.comp.programming.aspect.general
Message-ID <[email protected]>
>>Depends on whether with whatever technique you choose you achive to
>>implement the crosscut in a modular way, I would say.

when is a crosscut considered to be modular?

would a method that spits out bytecode for dynamic proxy logging considered 
to be modular?

public void EmitLogging(someThing)
{
    someThing.Emit(...);
    someThing.Emit(...);
}




>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.

well, no that was not what i mean.
I mean a factory that takes a type and inherits it in runtime , overriding 
every virtual method and in those injects a call to base/super and also some 
code to perform logging.
so in designtime your code does not contain any scattered code , but in 
runtime it does.
(just like any dynamic proxy aop approach.)

//Roger






----- Original Message ----- 
From: "Eric Bodden" <[email protected]>
To: "Roger Johansson" <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, April 05, 2006 3:08 PM
Subject: RE: [aosd-discuss] can you have interception w/o aop?


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 


__________________________________________________
AOSD Discuss mailing list    -    [email protected]
To unsubscribe go to http://aosd.net

Check out the AOSD.net Wiki: http://aosd.net/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.