Institute for Software Research International
School of Computer Science, Carnegie Mellon University
Open Modules: A Proposal for Modular Reasoning
in Aspect-Oriented Programming
First Version: March 2004
This report is now superceded by
Keywords: Open modules, modular reasoning, abstraction,
aspect-oriented programming, TinyAspect, types, modules, logical relations,
Aspect-oriented programming (AOP) is a new programming paradigm whose
goal is to more cleanly modularize crosscutting concerns such as
logging, synchronization, and event notification which would otherwise
be scattered throughout the system and tangled with functional code.
However, while AOP languages provide promising ways to separate
crosscutting concerns, they can also break conventional encapsulation
mechanisms, making it difficult to reason about code without the aid
of external tools.
We investigate modular reasoning in the presence of aspects through
TinyAspect, a small functional language that directly models
aspect-oriented programming constructs. We define Open Modules, a
module system for TinyAspect that enforces Reynolds' abstraction
theorem, a strong encapsulation property. Open Modules are ``open''
in that external aspects can advise functions and pointcuts in their
interface, providing significant aspect-oriented expressiveness that
is missing in non-AOP systems. In order to guarantee modular
reasoning, however, our system places limits on advice: external
aspects may not advise function calls internal to a module, except for
calls explicitly exposed through pointcuts in the module's interface.
The abstraction property of our system ensures that a module's
implementation can be changed without affecting clients, and provides
insight into formal reasoning, modular analysis, and tool support
for aspect-oriented programming.