Zero-Overhead Composable Aspects for .NET

  • Authors:
  • Rasmus Johansen;Peter Sestoft;Stephan Spangenberg

  • Affiliations:
  • IT University of Copenhagen, Denmark;IT University of Copenhagen, Denmark;IT University of Copenhagen, Denmark

  • Venue:
  • Advances in Software Engineering
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a new static aspect weaver for C# . The weaver, which is called Yiihaw, works by transforming a program's bytecode and types, stored in so-called assemblies, and performs extensive checks at weave-time to ensure correctness of the resulting woven assembly. The design makes four contributions: (a) Application of generic advice is typesafe; (b) application of "around" advice incurs no runtime overhead; (c) woven assemblies can be further woven; and (d) advice can itself be woven before being applied to target code --- in effect advice can be composed. These contributions are achieved by minimal means, basing much of the type checking on the bytecode's generic type system. Yiihaw's aspects are less expressive than those of AspectJ: an aspect does not have an identity of its own; only static join points are supported; and the pointcut language does not allow logical combinations of join points. However, Yiihaw is sufficiently expressive for many purposes, and for these purposes it provides statically typesafe weaving and highly efficient woven code.