A Formal Semantics of Flexible and Safe Pointcut/Advice Bindings
نویسندگان
چکیده
AspectJ was designed as a seamless aspect-oriented extension of the Java programming language. However, unlike Java, AspectJ does not have a safe type system: an accepted binding between a pointcut and an advice can give rise to type errors at runtime. In addition, AspectJ’s typing rules are severely restricting the definition of certain generic advice behavior. In this technical report, we present a formal semantics and a type system for an extension of AspectJ that addresses these issues. The type system, in particular, ensures safety for both generic and non-generic pointcut/advice declarations. Pointcuts quantify over heterogeneous sets of join points and are hence typed using type ranges in our approach, while type variables and a separate signature for proceed declarations allow to express the generic and invasive nature of advices. Using these mechanisms, we can express advice that augments, narrows or replaces base functionality in possibly generic contexts. Concretely, this report briefly reviews the type safety problems of pointcut/advice bindings in AspectJ-like languages and previous (partial) solutions to these problems that have been proposed in the literature. We then give a brief overview of our approach. Finally, we give a complete formal account of our approach by presenting evaluation rules, typing rules, type preservation and progress theorems as well as corresponding proofs.
منابع مشابه
ذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007