[Xotcl] AOP and XOtcl

Uwe Zdun uwe.zdun at uni-essen.de
Mon Sep 24 17:28:14 CEST 2001


Hi,

in the forthcoming XOTcl release will be several new filter features ... I've 
already reported on the obj-filters. Another feature we have ready are 
"filter guards". A filter guard is a condition whether a filter will be 
executed or not. It is registration-centric, thus you can append the 
conditions to the filter registration, example:

A instfilter {filter-1 {filter-2 {[self calledclass] == "::FigureElement"}}}

that means: filter-1 will always be executed (as in 0.85) .. filter-2 only 
wenn self calledclass is ::FigureElement. Of course, you can call methods 
from the filter guard, filters will not be applied to these calls.

Moreover, we have info (inst)filterguard and (inst)filterguard instcommands 
on Object/Class ...

I've a half-working AOP extension written in about 100 lines of code with 
this feature. Pointcuts can be defined in instprocs, so that you can do 
something like:

Aspect PointCutBoundsChecking
PointCutBoundsChecking appliesTo {FigureElement Point}
PointCutBoundsChecking pointcut setXs {
  [[self] calls "Point" "setX"] ||
  [[self] calls "FigureElement "setXY"] 
}
PointCutBoundsChecking before setXs {x} {
  if {$x < 100 || $x > 1000} {
    error "out of bounds x=$x"
  }
}


I hope to have a first version with the next XOTcl release ...

--Uwe

On Sunday 23 September 2001 12:08 pm, Catherine Letondal wrote:
> Hi,
>
> I guess there are interesting applications of XOtcl filters and
> mixins to aspect oriented programming? Are there any
> publications or work on this subject?
>
> Thanks,

-- 
Uwe Zdun
Institute for Computer Science, University of Essen
Phone: +49 201 81 00 332, Fax: +49 201 81 00 398
zdun@{xotcl,computer,acm}.org, uwe.zdun at uni-essen.de



More information about the Xotcl mailing list