Title: Discussion with Gregor Kiczales at UBC
1Discussion with Gregor Kiczales at UBC
- Ontology of AOP
- Ontology is the study of what there is, an
inventory of what exists. An ontological
commitment is a commitment to an existence claim
for certain entities. - Slides 2 - 5 and the last one are Gregors
An ontology is, in simple terms, a collection of
concepts with relations among them plus
constraints on the relations.
2basis of crosscutting
- a join point model (JPM) has 3 critical elements
- what are the join points
- in AspectJ
- points in runtime call graps members
- means of identifying join points
- in AspectJ
- signatures (plus )
- means of specifying semantics at join points
- in AspectJ
- advice
- define members
3basis of crosscutting
- a join point model (JPM) has 3 critical elements
- what are the join points
- in AspectJ
- points in runtime call graph
- class members
- means of identifying join points
- in AspectJ
- pointcuts
- member signatures (plus )
- means of specifying semantics at join points
- in AspectJ
- advice
- define members
dynamic JPMstatic JPM
4range of AOP languages
means of join points means of join points
JPM join points identifying specifying semantics at
AspectJ dynamic JPM points in execution call, get, set signaturesw/ wildcards other properties of JPs advice
static JPM class members signatures add members
Composition Filters message sends receptions signature property based object queries wrappers declarative (filters) imperative (advice)
Hyper/J members signatures add, compose (and remove) members
Demeter traversals when traversal reaches object or edge class edge names define visit method
5range of AOP languages
See next slide for changes to Demeter
6range of AOP languages
means of join points means of join points
JPM join points identifying specifying semantics at
AspectJ dynamic JPM points in execution call, get, set signaturesw/ wildcards other properties of JPs advice
static JPM class members signatures add members
DemeterJ, Demeter/C dynamic JPM static JPM 1 static JPM 2 static JPM 3 when traversal reaches object or edge class members class members class members visitor method signatures traversal spec. s class graph g class names class graph visitor method bodies s g (result traversal implementation) add members class graph with tokensgrammar (result parsing and printing implementation)
7range of AOP languages
8Composing join point models
- Traversal Spec JPM In Demeter we use traversal
specifications and the class graph to define a
traversal implementation (either static or
dynamic) - Visitor JPM The result of Traversal Spec. JPM is
used to define a second JPM - The traversal implementation defines nodes and
edge visits. - Visitor signatures define the nodes and edges
where additional advice is needed they are the
means of identifying join points. - The means of specifying semantics at join points
are the visitor bodies.
9DJ dynamic JPM 3
- The join points are nodes in object graphs. They
are not dynamic call graph join points nor class
members! - The means of identifying the join points for a
given object graph o are a strategy s and the
class graph g. o must conform to g. - The means of specifying the semantics at the join
points are again s and g. See paper with Mitch
Wand for the formal details behind this JPM.
10DemeterJ static JPM 1
- The means of identifying the join points and of
specifying the semantics at the join points are
the same. - The reason is that sg both
- select the classes that will get traversal
semantics - determine the details of the traversal semantics
11DemeterJ static JPM 3
- The means of identifying the join points (class
members) is done by the class graph. - When we add tokens to the class graph we get a
grammar that contains instructions for parsing
and printing behavior. - A grammar is an aspect (external representation
aspect) the adhoc implementation cuts across all
classes.
12AO design in UML
Clarke, Walker
- foo
- dynamic JPM ( AspectJ)
- what happens in pattern
- bar
- Composition Patterns
- static JPM ( Hyper/J)
- binds pattern to base code
- UML class interaction diagrams already crosscut
- by-class vs. by-interaction organizations
13Masuhara/Kiczales Modeling Framework for AO
Mechanisms
- A and B languages
- X result domain of weaving process
- XJP join points in X
- AID, BID identify join points in X
- AEff, BEff effecting semantics at jps
- META parameterize weaving process
14Masuhara/Kiczales Modeling Framework for AO
Mechanisms
- X
- XJP
- A
- AID
- AEff
- B
- BID
- BEff
- META
15Demeter static JPM 1 special case of Open Classes
Adds traversal methods to a set of classes
- X
- Combined program
- XJP
- c declarations
- A
- c declarations including the class graph
- AID
- Method signatures
- AEff
- B
- Traversal specifications
- BID
- c names
- BEff
- META
- Traversal semantics rules for translating
traversal specifications to methods
16Demeter static JPM 2 Open Classes
17Demeter static JPM 3 special case of Open Classes
Adds parsing methods to a set of classes
- X
- Combined program
- XJP
- c declarations
- A
- c declarations including the class graph
- AID
- Method signatures
- AEff
- B
- Class dictionary (class graph enhanced with
tokens defining the syntax addition) - BID
- c names
- BEff
- META
- rules for translating class dictionary to parsing
methods
18Demeter dynamic JPM 1 special case of Pointcuts
and Advice
Adds advice to traversal methods
- X
- Traversal execution
- XJP
- Arrival at each object and has-a edge
- A
- Traversal methods
- AID
- Method signatures
- AEff
- Execute traversal method body
- B
- Visitor method declarations (serves as advice)
- BID
- Visitor method signatures (serves as pointcut)
- BEff
- Execute visitor method bodies
- META
- none
19Demeter dynamic JPM 2 special case of TRAV
- For methods fetch, gather and asList special
advice
20Demeter dynamic JPM 3
- X
- Object graphs
- XJP
- Nodes in object graphs
- A
- Class graph
- AID
- Class names
- AEff
- B
- Traversal specification
- BID
- Class names
- BEff
- Edges to traverse at node in object graph
- META
- Rules for traversal order depth-first,
breadth-first, left-to-right, etc.
21Demeter dynamic JPM 4 DJ with Functional Visitor
- X
- Traversal execution with runtime control
(Subtraversal.apply(..)) - XJP
- Arrival at each object (Functional Visitor only
available to nodes) - A
- Regular Java Program (class/fields declarations)
- AID
- Class/fields signatures
- AEff
- Provide reachability (my understanding is to
construct object graph conforming to the class
graph) - B
- Traversal specification and visitor method
declarations (including the default one
combine(..)) - BID
- Visitor method signatures (or the built-in
semantics, for the combine(..)) - BEff
- Execute the visitor methods and compute and
combine the values and provide the runtime
control over the traversal(subset of the
traversal graph computed from the traversal
specification) - META
Mixes two models together
22Demeter dynamic JPM 4 DJ with Functional Visitor
- X
- Traversal execution with runtime control
(Subtraversal.apply(..)) - XJP
- Arrival at each object (Functional Visitor only
available to nodes) - A
- Regular Java Program defining traversals
(class/fields declarations) - AID
- Method signatures
- AEff
- Execute traversal method body
- B
- Visitor method declarations (including the
default method combine(..)) - BID
- Visitor method signatures (or the built-in
semantics, for the combine(..)) - BEff
- Execute the visitor methods and compute and
combine the values and provide the runtime
control over the traversal - META
Taken apart
23Conclusions
- The Modelling Framework by Masuhara/Kiczales
nicely captures the different AO mechanisms
worked on by the Demeter team.