A semantics for execution levels with exceptions
Summary (2 min read)
1. INTRODUCTION
- Aspect-oriented languages aim at modularizing crosscutting concerns.
- Subtle interactions between aspect and base exceptions and handlers may arise.
- A Logging aspect advises around the getConfiguration method.
2. EXECUTION LEVELS IN A NUTSHELL
- The authors first summarize the proposal of execution levels.
- An advice is a piece of code, and therefore its execution also produces join points.
- In higher-order aspect languages like AspectScript [12] and others, all pointcuts and advice are standard functions, whose application and evaluation produce join points as well.
- This of course opens the door to infinite regression and unwanted interference between aspects.
- By separating execution into levels, unwanted interactions between aspects are avoided.
3. SEMANTICS
- Which the authors then extend with exception handling.
- The complete semantics for the original language and the exception handling extensions are defined using PLT Redex, a domain-specific language for specifying reduction semantics [5].
- The complete semantics implementation, along an executable test suite, and examples shown in Section 4 are available at http://pleiad.cl/research/scope.
3.1 Original Semantics
- Tanter’s proposal defines a simple Scheme-like language with higher-order aspects, and execution levels as described in Section 2.
- The user-visible expressions are values, identifiers, if statements, multi-arity function application, and aspect deployment.
- A reduction relation → describes the operational semantics of their language using reduction steps.
- Aspect weaving ensures that pointcuts and advices are evaluated with up, and that the last proceed in the chain is evaluated with down [10].
- Rule APPSHIFT shows that when a level-capturing function is applied, it embeds the reduction of the application in an in-shift expression.
3.2 Exception Handling Semantics
- The authors introduce a standard exception handling mechanism [9], using the extensions shown in Figure 3.
- Certainly, there are situations where interaction is desired.
- The raise expression signals an exception that embeds a value to carry information to the handler.
- For simplicity the authors omit the propagation rules here.
- They are present in the downloadable complete semantics specification.
4. APPLICATIONS
- For all the examples the authors assume that the pointcut associated to the advice matches any function call.
- Thus, the base expression reduces to (raise0 #f).
- When the call to proceed raises the exception bound at level 0, the handler catches it because they are both bound to the same level.
- The examples show the key interactions between aspect and base handlers and exceptions, and the mechanism that their semantics provide to the programmer to specify the desired interaction.
Did you find this useful? Give us your feedback
Citations
21 citations
Cites background from "A semantics for execution levels wi..."
...Additional content on exception handling appears in the Proceedings of the Foundations of Aspect Languages Workshop 2011 [24]....
[...]
21 citations
15 citations
Cites background from "A semantics for execution levels wi..."
...He illustrated the extensibility approach with execution levels [32] and level-aware exception handling [10]....
[...]
10 citations
Cites background from "A semantics for execution levels wi..."
...A Practical Monadic Aspect Weaver Ismael Figueroa * Éric Tanter PLEIAD Laboratory Computer Science Department (DCC) University of Chile Chile {i.guero,etanter}@dcc.uchile.cl Abstract We present Monascheme, an extensible aspect-oriented programming language based on monadic aspect weaving....
[...]
...He then defined the execution level monad, and two exception transformers to provide flat (standard exceptions that do not have access to the level of execution), and levelaware [4] exceptions to execution levels....
[...]
...[4] I. Figueroa and É. Tanter....
[...]
...In subsequent work, Figueroa and Tanter [4] address the exception conflation problem, that is, the problematic interactions between aspect and base code in presence of an exception handling mechanism....
[...]
...Tanter proposed execution levels for AOP [9] as a means to structure computation and avoid in.nite regression by default, while providing .exibility to the programmer when required....
[...]
9 citations
Cites background from "A semantics for execution levels wi..."
...He illustrated the extensibility approach with execution levels [41] and levelaware exception handling [13]....
[...]
References
91 citations
"A semantics for execution levels wi..." refers methods in this paper
...in [3], as well as some others like using the Contract4J design-by-contract framework....
[...]
...[3] study the interaction between aspects and exceptions in three systems with a Java and AspectJ versions available....
[...]
61 citations
"A semantics for execution levels wi..." refers background or methods in this paper
...The complete rules for aspect deployment are shown in Tanter’s proposal [10], and are not changed in our proposal....
[...]
...In this paper we propose a semantics for an aspect-oriented language that discriminates aspect and base exceptions using execution levels, extending Tanter’s original proposal [10]....
[...]
...Aspect weaving ensures that pointcuts and advices are evaluated with up, and that the last proceed in the chain is evaluated with down [10]....
[...]
...In order to address the above issue, Tanter proposed execution levels for AOP [10]....
[...]
...The language has booleans, numbers and lists, primitives functions to operate on these, and an internal app/prim operator to apply functions without generating join points [10]....
[...]
59 citations
"A semantics for execution levels wi..." refers background in this paper
...In higher-order aspect languages like AspectScript [12] and others, all pointcuts and advice are standard functions, whose application and evaluation produce join points as well....
[...]
...AspectScript: Expressive aspects for the Web....
[...]
...In higher-order aspect languages like AspectScript [12] and others, all pointcuts and advice are standard functions, whose application and evaluation produce join points as well....
[...]
52 citations
"A semantics for execution levels wi..." refers background in this paper
...However, all these approaches eventually fall short for they fail to address the fundamental problem, which is that of conflating levels that ought to be kept separate [2]....
[...]
42 citations
Related Papers (5)
Frequently Asked Questions (2)
Q2. What have the authors stated for future works in "A semantics for execution levels with exceptions" ?
To further illustrate the benefits of their proposal, the authors plan to extend the AspectJ implementation with execution levels described by Tanter et al. in [ 11 ] with their exception handling semantics. Using this implementation the authors will make case studies similar to the ones done by Coelho et al. in [ 3 ], as well as some others like using the Contract4J design-by-contract framework.