On Tuesday, Aug 19, 2003, at 22:35 Europe/Rome, Miles Elam wrote:
Is only one interception possible?
No, of course not. You could have multiple interceptions, for example
main.js
function getBlah() {
return createBlah();
}interceptor1.js
function get*() {
before();
continueExecution(arguments);
after();
}interceptor2.js
function get*() {
before();
continueExecution(arguments);
after();
}then, somewhere, it is defined that
[main.js -(wrapped by)-> interceptor1.js] -(wrapped by) -> interceptor2.js
so, by calling getBlah() the resulting virtual function will be
function getBlah() {
before() // from interceptor2
before() // from interceptor1
_blah = createBlah()
after() // from interceptor1
after() // from interceptor2
return blah
}Authentication is one use case for an interception. Authorization could be another. I'm sure there are others. Would multiple calls to cocoon.apply(...) be possible? Would they be order dependent?
Yes. Order of interception will need to be meaningful.
Also, am I correct in the assumption that the wildcard is intended to match target functions?
yes
Doesn't that tie the two files too closely together?
it does create a contract on the function naming, yes. But I think this is a good thing.
Or is this a change to the sitemap calling syntax. Does the sitemap call getwhatever(...), a get* function intercepter catches it and then eventually passes the call down to whatever(...)?
nononon, that would be totally against the spirit of aspect orthogonality.
they key idea of transparent aspect layering is that you can remove the aspect without touching the rest of the code.
-- Stefano.
