View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] AOP and XOtcl

From: Uwe Zdun <uwe.zdun_at_uni-essen.de>
Date: Mon, 24 Sep 2001 17:28:14 +0200

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_at_{xotcl,computer,acm}.org, uwe.zdun_at_uni-essen.de