Adding trace matching with free variables to AspectJ

被引:170
作者
Allan, C
Avgustinov, P
Christensen, AS
Hendren, L
Kuzins, S
Lhoták, O
de Moor, O
Sereni, D
Sittampalam, G
Tibble, J
机构
[1] Univ Oxford, Programming Tools Grp, Oxford OX1 2JD, England
[2] Univ Aarhus, BRICS, Aarhus, Denmark
[3] McGill Univ, Sable Res Grp, Montreal, PQ, Canada
关键词
languages; design; theory; program monitoring; aspect-oriented programming;
D O I
10.1145/1103845.1094839
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
An aspect observes the execution of a base program;, when certain actions occur, the aspect runs some extra code of its own. In the AspectJ language, the observations that an aspect can make are confined to the current action: it is not possible to directly observe the history of a computation. Recently, there have been several interesting proposals for new history-based language features, most notably by Douence et al. and by Walker and Viggers. In this paper, we present a new history-based language feature called tracematches that enables the programmer to trigger the execution of extra code by specifying a regular pattern of events in a, computation trace. We have fully designed and implemented tracematches as a seamless extension of AspectJ. A key innovation in our tracematch approach is the introduction of free variables in the matching patterns. This enhancement enables a whole new class of applications in which events can be matched not only by the event kind, but; also by the values associated with the free variables. We provide several examples of applications enabled by this feature. After introducing and motivating the idea of tracematches via examples, we present a detailed semantics of our language design, and we derive an implementation from that semantics. The implementation has been realised as an extension of the abc compiler for AspectJ.
引用
收藏
页码:345 / 364
页数:20
相关论文
共 30 条
  • [1] *ABC, ASP COMP
  • [2] [Anonymous], 2003, MASTERING ASPECTJ AS
  • [3] Ball T, 2004, LECT NOTES COMPUT SC, V2999, P1
  • [4] BOCKISCH C, 2005, 2 DYN ASP WORKSH DAW, P71
  • [5] BODDEN E, 2005, SPLAT WORKSH AOSD DO
  • [6] CIBRAN MA, 2005, 2 DYN ASP WORKSH DAW, P13
  • [7] Colyer A., 2004, ECLIPSE ASPECTJ ASPE
  • [8] DOUENCE R, 2002, P ACM SIGPLAN SIGSOF, P173
  • [9] DOUENCE R, 2001, LECT NOTES COMPUTER, V2192, P170, DOI DOI 10.1007/3-540-45429-2_13
  • [10] DOUENCE R, 2005, ASPECT ORIENTED SOFT, P27