Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Untyped Calculus of Aspect- Oriented Programs Radha Jagadeesan Alan Jeffrey James Riely DEPAUL UNIVERSITY, CHICAGO.

Similar presentations


Presentation on theme: "An Untyped Calculus of Aspect- Oriented Programs Radha Jagadeesan Alan Jeffrey James Riely DEPAUL UNIVERSITY, CHICAGO."— Presentation transcript:

1 An Untyped Calculus of Aspect- Oriented Programs Radha Jagadeesan Alan Jeffrey James Riely DEPAUL UNIVERSITY, CHICAGO

2 Aspect Oriented Programming AOSD. Systematic methodology to address cross-cutting concerns A standard example: logging AOP. Language support to ``localize’’ cross cutting code This talk. About AOP languages

3 Specification via translation Weaving: describe operational semantics of a AOP language via compilation to the underlying paradigm. Aspect + Java ! Java Aspect + Scheme ! Scheme Aspect + ML ! ML Aspect + C ! C

4 AOP languages and OO languages: Folklore Execution in OO languages is an instance of execution in AOP languages Translation from OO programs P to AOP program P asp P 1 ! P 2, P 1 asp ! P 2 asp

5 AOP languages and OO languages: Folklore  Execution in OO languages is an instance of execution in AOP languages  Aspects interfere with OO principles

6 Aspects interfere with OO programming D1, D2 are distinguishable.

7 Aspects as first class entities?  Source semantics is non-trivial.  Aspects + OO: redundancy  Aspects interfere with OO principles

8 Rest of the talk Overview of results A sketch of the technical development

9 A calculus of AO programs Identify a core set of orthogonal primitives Only AROUND advice No method bodies Only call/execution pointcuts Direct description of the operational semantics of aspect based programs

10 So what? Dynamic arrival of new advice permitted.

11 Specification of weaving No reductions are lost No new reductions

12 Limitations Limited vocabulary of pointcuts. Only call/execution join points Reflection, cflow not included Global specification of advice order

13 Rest of this talk: A sketch of the main ideas An overview of call vs. execution The aspect calculus Weaving

14 An Advised Method call o:C u:D u.foo() a proceed() o.foo(u)

15 An Advised Method call o:C u:D u.foo() a proceed() o.foo(u)

16 Call advice Executed in the controlling context of the caller

17 An Advised Method call o:C u:D u.foo() a proceed() o.foo(u)

18 Execution advice Executed in the controlling context of the callee

19 Rest of this talk An overview of call vs.. execution The aspect calculus Weaving

20 The Aspect Calculus Class declarations Pointcuts Advice

21 The Aspect Calculus: Classes Class = list of method names Methods have no code

22 The Aspect Calculus: Pointcuts

23 The Aspect Calculus: Advice Given fixed global ordering on advice names

24 Reduction rules: context

25 Reduction rules: fetching advice Keep track of controlling object p{…} Call advice determined by static type. Execution advice determined by dynamic type

26 Reduction rules: call advice Controlling context of caller p Substitutions for this, target proceed, parameters

27 Reduction rules: execution advice Controlling context of callee o Substitutions for this, target proceed, parameters

28 Encoding Class Based Language 1 Create an exec advice for each method body

29 Encoding Class Based Language 2 proceed cbl_d_m cbl_c_m Name cbl_d_m precedes name cbl_c_m in ordering on advice names

30 Rest of this talk An overview of call vs. execution The aspect calculus Weaving

31 Programs that dynamically load advice affecting existing classes cannot be woven statically. For static advice, weaving algorithm is (by now) standard. Novelty is specification of weaving.

32 Weaving: Basic idea View as a kind of macro-expansion. To weave Weave recursively and associate result to the body of method m

33 Weaving Alas. This doesn’t necessarily terminate. However, postpone macro-expansion to runtime by freezing inside method bodies. Formalized in paper.

34 A subtlety in correctness proof Weaving of intermediate configurations requires knowledge of controlling object

35 Rest of this talk An overview of call vs. execution The aspect calculus Weaving Summary

36 This talk: A calculus of AOP programs Identify a core set of orthogonal primitives Direct description of the execution of programs in an aspect language.

37 Moving along Scale: Larger variety of pointcuts. Accurate treatment of advice order. Source level typing


Download ppt "An Untyped Calculus of Aspect- Oriented Programs Radha Jagadeesan Alan Jeffrey James Riely DEPAUL UNIVERSITY, CHICAGO."

Similar presentations


Ads by Google