1 / 37

An Untyped Calculus of Aspect-Oriented Programs

An Untyped Calculus of Aspect-Oriented Programs. Radha Jagadeesan Alan Jeffrey James Riely DEPAUL UNIVERSITY, CHICAGO. Aspect Oriented Programming. AOSD. Systematic methodology to address cross-cutting concerns A standard example: logging

shiro
Download Presentation

An Untyped Calculus of Aspect-Oriented Programs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 Pasp P1! P2, P1asp! P2asp

  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 u.foo() o:C a proceed() o.foo(u) u:D

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

  16. Call advice • Executed in the controlling context of the caller

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

  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. Class declarations Pointcuts Advice The Aspect Calculus

  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 Name cbl_d_m precedes name cbl_c_m in ordering on advice names proceed cbl_c_m cbl_d_m

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

  31. Weaving 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

More Related