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
8 citations
7 citations
Cites background from "A semantics for execution levels wi..."
...More recently, Figueroa and Tanter (2011) proposed the explicit se of Execution Levels (Tanter, 2010) as a means to avoid many of he bugs that error handling aspects introduce....
[...]
4 citations
Cites background from "A semantics for execution levels wi..."
...He illustrated the extensibility approach with execution levels (Tanter, 2010) and level-aware exception handling (Figueroa and Tanter, 2011)....
[...]
...Tangentially related to this thesis, the author also co-authored an extension to execution levels (Figueroa and Tanter, 2011), as well as the extended version of that work (Tanter et al....
[...]
3 citations
Cites background from "A semantics for execution levels wi..."
...He illustrated the extensibility approach with execution levels (Tanter, 2010) and level-aware exception handling (Figueroa and Tanter, 2011)....
[...]
...Tangentially related to this thesis, the author also co-authored an extension to execution levels (Figueroa and Tanter, 2011), as well as the extended version of that work (Tanter et al....
[...]
[...]
Cites methods from "A semantics for execution levels wi..."
...[2], and have been successfully applied to distribution [10] and access control [13–15]; execution levels [3, 9], which avoid infinite regression and computational interference between aspects, and have been applied to compose dynamic analyses aspects [11]; and membranes [4, 12], which allow more flexible topological scoping and local weaving customization....
[...]
References
2,391 citations
"A semantics for execution levels wi..." refers methods in this paper
...We introduce a standard exception handling mechanism [9], using the extensions shown in Figure 3....
[...]
285 citations
"A semantics for execution levels wi..." refers methods in this paper
...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]....
[...]
258 citations
Additional excerpts
...[8] M. Lippert and C. V. Lopes....
[...]
...RELATED WORK The .rst approach dealing with exception handling as a crosscutting concern was the study done by Lippert and Lopes [8]....
[...]
...The first approach dealing with exception handling as a crosscutting concern was the study done by Lippert and Lopes [8]....
[...]
136 citations
133 citations
"A semantics for execution levels wi..." refers background in this paper
...[7] studied the adequacy of AspectJ for modularizing and reusing exception-handling code....
[...]
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.