From: Andrei Alexandrescu (andrei@cs.washington.edu)
Date: Tue Nov 05 2002 - 13:18:48 PST
AOP would allow enforcing some of ArchJava's communication integrity
constraints in two ways. Talking about the Scanner-Parser-CodeGen foodchain:
1. AOP can enforce statically that, for example, no calls are made to the
Parser from within Scanner's definition. The syntax would be
(approximately):
aspect integrity {
pointcut illegal_call() : within(Scanner) && call(* Parser.*(..));
declare error:
illegal_call() : "You are not allowed to call into the Parser from
the Scanner";
};
2. AOP can enforce dynamically that no Parser method is called directly *or
indirectly* from any Scanner function by using the cflow primitive:
aspect dynamic_integrity {
pointcut illegal_call() : cflow(* Scanner.*(..)) && call(*
Parser.*(..));
before(illegal_call()) {
throw new Exception("You are not allowed to call into the Parser
from the Scanner");
}
};
This bears an interesting resemblance with ArchJava's two methods (static
and dynamic) to enforce communication integrity; one disallows function
calls within certain contexts, the other disallows specific casts within
certain contexts.
Of course, ArchJava does much more than just ruling out illegal calls. A
comparison with what you can do with AOP and what supplemental benefits
ArchJava offers might be interesting.
Andrei
_______________________________________________
Cecil mailing list
Cecil@cs.washington.edu
http://majordomo.cs.washington.edu/mailman/listinfo/cecil
This archive was generated by hypermail 2.1.5 : Tue Nov 05 2002 - 13:22:42 PST