[PEAK] Persistence styles, MDA, AOP, PyProtocols, and PEAK

Dominikus Herzberg dominikush at yahoo.com
Thu Jul 15 13:25:59 EDT 2004


> Sorry if that was unclear.  The parallel I drew between CLOS generic 
> functions and AspectJ is that AspectJ does AOP by way of "advice", which is 
> generally in terms of "before, after, and around".  "Before advice" is code 
> that runs before something, after runs after, and "around" has a chance to 
> call the old version of the code, after modifying parameters or before 
> modifying the return result.  (Or can replace it altogether.)

Now it clicked! I see the point: before, after and around let you sort of
"redirect" the function call. Ok, and this technique can be used to also
implement composition filters, which is another AOP approach. Nice!
 
> [...]

> Anyway, timing, caching/memoization, logging, tracing, persistence, and 
> various other non-functional aspects can be implemented in this way.  While 
> the basic mechanism isn't quite as broad as AspectJ, and can't be applied 
> to truly "oblivious" code, I believe it is "close enough" to be sufficient 
> AOP for our purposes, and easier to use than PEAK's current AOP 
> implementation for these types of aspects.

Generic functions do not imitate AOP to the full extend. As you indicated,
some infrastructure is needed. But what you drew my attention to is that
you identified a basic language feature (generic functions) that enables
you to do such cool stuff. I wasn't fully aware of this, but now -- as I
see it clearly -- I think it's quite convincing.

Thanks a lot for your answer!

Greetings,

Dominikus 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 



More information about the PEAK mailing list