Complex behavior often resists clean modularization in object-oriented languages. Aspectoriented programming tackles this problem by providing ¤exible module boundaries that can span and partition classes. However, in order to achieve this ¤exibility, valuable modularity mechanisms, such as encapsulation and external composition, are lost. The ability to separately compile or reason about a modular unit is also compromised. We propose that this tradeoff is not necessary, and that by expressing aspects as part of our modules, we can restore lost modular properties while maintaining aspectual features. As a concrete demonstration, we present the main features of Aspectual Collaborations, and show how these interact to combine modularity with aspectual behavior. The expressiveness of Aspectual Collaborations, AspectJ, and Hyper/J are compared using a challenge problem, allowing us to estimate the effectiveness of the approach.
Adaptive programs compute with objects, just like object-oriented programs. Each task to be accomplished is specified by a so-called propagation pattern which traverses the receiver object. The object traversal is a recursive descent via the instance variables where information is collected or propagated along the way. A propagation pattern consists of (1) a name for the task, (2) a succinct specification of the parts of the receiver object that should be traversed, and (3) code fragments to be executed when specific object types are encountered. The propagation patterns need to be complemented by a class graph which defines the detailed object structure. The separation of structure and behavior yields a degree of flexibility and understandability not present in traditional object-oriented languages. For example, the class graph can be changed without changing the adaptive program at all. We present an efficient implementation of adaptive programs. Given an adaptive program and a class graph, we generate an efficient object-oriented program, for example, in C++. Moreover, we prove the correctness of the core of this translation. A key assumption in the theorem is that the traversal specifications are consistent with the class graph. We prove the soundness of a proof system for conservatively checking consistency, and we show how to implement it efficiently.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.