Introduction: The era of AOP technology has come, but how can we choose the right tool for the project? In the first article of the newly launched Aop@work series, the aspect-oriented (aspect-oriented) programming expert Mik Kersten will compare 4 leading AOP tools (AspectJ, Aspectwerkz, JBoss AOP, and Sprin G AOP) to help you decide which tool you should choose. This article is composed of two parts, in which the author will focus on the language mechanism of these tools and the pros and cons of different technologies. He uses 4 tools to write the same example, giving the reader a sense of the high-level differences between them. He will also discuss the effects of the grammatical techniques of each tool on AOP semantics. At the end of the article, the author makes an in-depth comparison of the core language mechanisms of the tool, such as pointcut matching and grouping, notification formats, and connection point contexts. Note that this article will explain the implications of the recently announced AspectJ and Aspectwerkz project consolidation.
Aspect-oriented programming (AOP) is becoming increasingly popular on Java™ platforms. With the increase of AOP publications and conferences, this technology has more tools and implementations. While it is clear that AOP is a complement to object-oriented technology, it is relatively less clear how Java developers can evaluate the current AOP tools, especially the pros and cons of each new technology implementation.
This article has two parts, and this article is the first of a new AOP series in DeveloperWorks. In this article, you will summarize the current technical state of the AOP tools and compare some of the most mature methods for the technology: AspectJ, Aspectwerkz, JBoss AOP, and Spring AOP, and compare the issues associated with the adoption of each method. The implications of the recently announced AspectJ and Aspectwerkz project consolidation are also explained (see Resources).
This article is not intended as an introduction to AOP or as an introductory reading for a particular AOP implementation. Instead, it outlines the most common AOP technologies currently in use. A discussion of the inherent pros and cons of each tool's language mechanism and tool support will help you choose the most appropriate technology for your project. The metrics defined here also make it easier for readers to assess upcoming AOP tools and features. For a list of the latest articles on AOP on DeveloperWorks, see Resources.
Please note that this article has two parts, for the convenience of readers, two parts of the simultaneous release. Part 1th focuses on the respective AOP language mechanism processing techniques of these 4 leading tools, including the aspects of tool syntax (aspect syntax) and the representation of pointcuts, the scope of the mechanism used to declare aspects, and so on. Part 2nd continues to delve into how leading AOP implementations integrate with existing development environments, tools, and libraries. This section includes topics such as aspect designers, IDE plug-ins, scalability, and the future direction of AOP tools, as well as concerns about the recent consolidation of AspectJ and Aspectwerkz projects.
Choose a mature tool
AOP is a new technology, so not all of the tools available are ripe for commercial development. A major factor in judging maturity is the degree of user adoption. Before considering applying a new programming technology to business, the technology must be enhanced by feedback from the active user community. Table 1 shows the currently available AOP tools listed in Aosd.net (see Resources). The number of user list posts per tool can indicate its user base (omitting the actual number of posts, since a separate one-month statistic can be misleading to readers).
Table 1. Number of posts in the November 2004 AOP Tools User List