Chapter 9. Trace-Based AspectsREMI DOUENCE, PASCAL FRADET, AND MARIO SÜDHOLT This chapter presents trace-based aspects, a model that takes into account the history of program execution in deciding what aspect behavior to invoke. That is, aspect behavior is invoked depending on relations among events of the execution history. With trace-based aspects, weaving is accomplished through an execution monitor that modifies the program execution to include the behavior specified by the aspects. We motivate trace-based aspects and explore the trade-off between expressiveness and property enforcement/analysis. More concretely, we first present an expressive model of trace-based aspects enabling proofs of aspect properties by equational reasoning. Using a restriction of the aspect language to regular expressions, we address the difficult problem of interactions between conflicting aspects. Finally, by restricting the actions performed by aspects, we illustrate how to keep the semantic impact of aspects under control and how to implement weaving statically. |