摘要
Implementing crosscutting concerns for transactions is difficult, even using aspect-oriented programming languages such as AspectJ. Many of these challenges arise because the context of a transaction-related crosscutting concern consists of loosely-coupled abstractions like dynamically-generated identifiers, timestamps, and tentative value sets of distributed resources. Current aspect-oriented programming languages do not provide joinpoints and pointcuts for weaving advice into high-level abstractions or contexts, like transaction contexts. To address these problems, we propose an extension to AspectJ framework, called TransJ, that allows developers to define pointcuts in terms of transaction abstractions and that automatically keeps track of context information for transactions. This paper describes TransJ as an abstract independent framework for weaving crosscutting concerns into high-level runtime abstractions, with which developers can implement transaction-related crosscutting concerns in modular, cohesive and loosely coupled transaction-aware aspects. Finally, this paper presents eight different ways in which TransJ can improve the reuse with preserving the performance of applications requiring transactions. Informally, these hypotheses are that TransJ yields (1) better encapsulation and separation of concern; (2) looser coupling and less scattering; (3) higher cohesion and less tangling; (4) reduces complexity; (5) improves obliviousness; (6) preserves efficiency; (7) improves extensibility; and (8) hastens the productivity. A brief discussion of experiment to test the hypotheses is provided, but the details of the experiment are left for another paper.