Opentopia Directory Encyclopedia Tools

AspectJ

Encyclopedia : A : AS : ASP : AspectJ


AspectJ is an aspect-oriented extension to the Java programming language created at Xerox PARC and now available in Eclipse Foundation open-source projects, both stand-alone and integrated into Eclipse. AspectJ has become the widely-used de-facto standard for AOP by emphasizing simplicity and usability for end users. It uses Java-like syntax and has included IDE integrations for displaying crosscutting structure since its initial public release in 2001.

Simple Language Description

All valid Java programs are also valid AspectJ programs, but AspectJ also allows programmers to define special constructs called aspects. Aspects can contain several entities unavailable to standard classes. These are:

:aspect VisitAspect
:}
:pointcut set() : execution(* set*(..) ) && this(Point);
:after () : set()
AspectJ also supports limited forms of pointcut-based static checking and aspect reuse (by inheritance). See the [AspectJ Programming Guide] for a more detailed description of the language.

AspectJ compatibility and implementations

AspectJ has been designed to be implemented in many ways, including source- or bytecode-weaving and directly in the VM. In all cases, the AspectJ program is transformed into a valid Java program run in a Java VM. Any classes affected by aspects are binary-compatible with the unaffected classes (in order to maintain compatibility with any classes that were compiled with the unaffected originals). Supporting multiple implementations allows the language to grow as technology changes, and being Java-compatible ensures platform availability.

Key to its success has been engineering and language decisions designed to make the language usable and programs deployable. The original Xerox AspectJ implementation used source weaving, which required access to source code. When Xerox contributed the code to Eclipse, AspectJ was reimplemented using the Eclipse Java compiler and a bytecode weaver based on BCEL, so developers could write aspects for code in binary (.class) form. At this time the AspectJ language was restricted to support a per-class model essential for incremental compilation and load-time weaving. This made IDE integrations as responsive as their Java counterparts, and it enabled developers to deploy aspects without altering the build process. This lead to increased adoption, as AspectJ became usable for impatient Java programmers and enterprise-level deployments. Since then, the Eclipse team has increased performance and correctness, upgraded the AspectJ language to support Java 5 language features like generics and annotations, and integrated annotation-style pure-java aspects from AspectWerkz.

The Eclipse project supports both command-line and Ant interfaces. A related Eclipse project has steadily improved the Eclipse IDE support (AJDT) for AspectJ and other providers of crosscutting structure. IDE support for emacs, Netbeans, and JBuilder foundered when Xerox put them into open source, but support for Oracle's JDeveloper did appear. IDE support has been key to ordinary Java programmers using AspectJ and understanding crosscutting concerns.

BEA has offered limited support in a VM for aspect-oriented extensions, but for extensions to be supported in all Java VM's would require agreement through Sun's Java Community Process.

Academic interest in both the semantics and implementation of aspect-oriented languages has surrounded AspectJ since its release. The leading research implementation of AspectJ is Aspect Bench Compiler, or [abc]; it supports extensions for changing the syntax and semantics of the language and forms the basis for many AOP experiments that the AspectJ team can no longer support, given its broad user base.

Many programmers discover AspectJ as an enabling technology for other projects they use, most notably Spring AOP.

History and contributors

Gregor Kiczales started and led the Xerox PARC team that eventually developed AspectJ; he coined the term "crosscutting". Fourth on the team, Chris Maeda coined the term "aspect-oriented programming." Jim Huginin and Erik Hilsdale (Xerox PARC team members 12 and 13) were the original compiler and weaver engineers, as Adrian Colyer and Andrew Clement are on the Eclipse project.

Jonas Boner and Alex Vasseur engineered the AspectWerkz project, and later contributed to the AspectJ project when it merged in the AspectWerkz annotation style and load-time weaving support.

Oege de Moor leads the Oxford team developing the [abc] compiler.

See also

External links

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: