Frequently Asked Questions about AspectJ


© Copyright 1997-2001 Xerox Corporation. All rights reserved.

Last updated for AspectJ 1.0rc1

1 AspectJ Overview
1. What is AspectJ?
2. What are the benefits of using AspectJ?
3. What is the current status of AspectJ?
4. Can AspectJ work with any Java program?
2 Similar Technology
1. How does AspectJ compare to other new forms of programming?
2. How do you compare the features of AspectJ with reflective systems?
3. How do AspectJ features with those of mixin-based inheritance?
4. Will you support C#
3 Adopting AspectJ
1. How do I start using AspectJ?
2. What kind of support is available?
3. How well does AspectJ integrate with existing Java development tools?
4. What plans are there to support my IDE?
5. Can I port AJDE support to my development environment?
6. Is it safe to use AspectJ in my product plans?
7. How is AspectJ licensed?
8. How do I submit a bug report?
4 Getting Help
1. How do I find out more about AspectJ?
2. How do I communicate with other AspectJ users?
3. Can you recommend reading or teaching material for AspectJ?
5 Developing with AspectJ
1. What kind of IDE support is available for developing AspectJ programs?
2. Are aspect libraries available?
3. How do I submit comments and feature requests?
4. What Java virtual machine (JVM) do I use to run the AspectJ compiler?
5. Are there any issues using AspectJ with the Microsoft JVM?
6. How can I use ajc to compile programs for a JVM that is different from the one used to run it?
7. How do I know which aspects affect a class when looking at that class's source code?
8. I have to list many files in the command line to compile with ajc. Is there any other way to provide the file names to ajc?
9. Is it necessary to compile all my source files with AspectJ if I use aspects?
6 AspectJ Design
1. It looks like aspects break the manifest interface of a class since they can access and modify all data members. Why did you make that decision?
2. Are aspects always optional or non-functional parts of a program?
3. Are crosscutting concerns induced by flaws in parts of the system design, programming language, operating system, etc. Or is there something more fundamental going on?
4. Does it really make sense to define aspects in terms of cross-cutting?
5. Is AOP restricted to domain-specific applications?
6. Can I use AspectJ with Generic Java?
7 Technical Issues
1. What is the effect of using AspectJ on the source code size of programs?
2. Are there any plans to incorporate the ability to perform AOP operations on existing Java bytecode (.class) files in addition to their source equivalents?
3. Does ajc rely on javac for generating Java bytecode (.class) files?
4. Does AspectJ add any performance overhead?
8 AspectJ Administrivia
1. How do I download and install AspectJ?
2. ajc is using the wrong JVM. How do I fix it?
3. ajc complains that it can't find javac. What's wrong?
4. How do uninstall AspectJ?
5. The AspectJ compiler aborts with an out-of-memory error when compiling many classes. How can I fix this?
9 The AspectJ Language
1. What are the differences between the current and previously released versions of AspectJ?
2. What are join points?
3. What is a pointcut?
4. What is advice?
5. What is an aspect?
6. Is it possible to introduce keywords (like synchronized) on methods?
7. How does ajc interact with the serialVersionUID?
10 About the AspectJ Project
1. What does the fact that AspectJ is an Open Source Project mean to me?
2. What are your plans to make AspectJ a general feature of Java supported by Sun and the other key-players in the Java Industry?
3. What is the AspectJ development schedule?

1 AspectJ Overview

1. What is AspectJ?

AspectJ is a simple and practical extension to the Java programming language that adds to Java aspect-oriented programming (AOP) capabilities. AOP allows developers to reap the benefits of modularity for concerns that cut across the natural units of modularity. In object-oriented programs like Java, the natural unit of modularity is the class. In AspectJ, aspects are concerns that affect more than one class.

AspectJ includes a compiler (ajc), a debugger (ajdb), a documentation generator (ajdoc), and integration with JBuilder, Forte and GNU Emacs/XEmacs.

2. What are the benefits of using AspectJ?

AspectJ can be used to improve the modularity of software systems.

Using ordinary Java, it can be difficult to modularize design concerns such as

  • system-wide error-checking strategies

  • design patterns

  • synchronization policies

  • resource sharing

  • distribution concerns

  • performance optimizations

The code for these concerns tends to be spread out across the system. Because these concerns won't stay inside of any one module boundary, we say that they crosscut the system's modularity.

AspectJ adds constructs to Java that enable the modular implementation of crosscutting concerns. This ability is particularly valuable because crosscutting concerns tend to be both complex and poorly localized, making them hard to deal with.

3. What is the current status of AspectJ?

AspectJ is an evolving aspect-oriented extension to Java. It is based on over ten years of research at Xerox Palo Alto Research Center, funded by Xerox, a U.S. Government grant (NISTATP), and a DARPA contract.

Current development of the system is focused on stabilizing the language, improving compiler performance and integration with IDEs and other code development tools like javadoc. This development is being guided by feedback from the AspectJ user community.

The latest release is 1.0rc1 which can be downloaded from the AspectJ download page.

4. Can AspectJ work with any Java program?

AspectJ has been designed as a compatible extension to Java. By compatible, we mean

upward compatibleAll legal Java programs are legal AspectJ programs.
platform compatibleAll legal AspectJ programs run on standard Java virtual machines.
tool compatibleExisting tools can be extended to work with AspectJ.
programmer compatibleProgramming in AspectJ feels natural to Java programmers.

The AspectJ tools run on any Java 2 Platform compatible platform.

2 Similar Technology

1. How does AspectJ compare to other new forms of programming?

There are many recent proposals for programming languages that provide control over crosscutting concerns. Aspect-oriented programming is an overall framework into which many of these approaches fit. AspectJ is one particular instance of AOP, distinguished by the fact that it was designed from the ground up to be compatible with Java.

See the Related Sites page of the AspectJ web site for more information.

2. How do you compare the features of AspectJ with reflective systems?

Reflective and aspect-oriented languages have an important similarity: both provide programming support for dealing with crosscutting concerns. In this sense reflection was the existence proof that independent programming of crosscutting concerns is possible.

But the control that reflection provides tends to be low-level and extremely powerful. In contrast, AspectJ provides more carefully controlled power, drawing on the rules learned from object-oriented development to encourage a clean and understandable program structure.

3. How do AspectJ features with those of mixin-based inheritance?

Some features of AspectJ, such as introduction, are related to mixin-based inheritance. But, in order to support crosscutting, a core goal for AspectJ, AspectJ goes beyond mixin-based inheritance.

Firstly, an aspect imposes behavior on a class, rather than a class requesting behavior from an aspect. An aspect can modify a class without needing to edit that class. This property is sometimes called reverse inheritance.

Secondly, a single aspect can affect multiple classes in different ways. A single paint aspect can add different paint methods to all the classes that know how to paint, unlike mixin classes.

Finally, aspect instances support state crosscutting in a way that mixin-based inheritance cannot.

4. Will you support C#

Not at this time. Although the resemblances between C# and Java means it would probably be a fairly straightforward matter to take the AspectJ language design and produce AspectC#, our current focus is only on producing a stable AspectJ 1.0 release.

3 Adopting AspectJ

1. How do I start using AspectJ?

In order of increasing complexity, you may

  • In the development process Use AspectJ just to trace or log interesting information. You can do this by adding to any Java program simple AspectJ code that performs logging or tracing of objects. This kind of addition may be removed for the final build since it does not implement a design requirement; the functionality of the system is unaffected by the aspect.

  • As an ancillary part of your system Use AspectJ as a more involved testing harness. Add more sophisticated code that can help with either debugging or testing. This code may also usually be removed from the final build.

  • As an essential part of your system Use AspectJ to factor out some crosscutting concern in the core of your system. Add AspectJ code that implements some design requirement. This code cannot be removed from the final build.

This adoption sequence works very well in practice and has been followed by many users.

2. What kind of support is available?

Simple development support is available through the support mailing list, and the AspectJ users mailing list provides an informal network of AspectJ experts. To subscribe to either list, visit the Mailing Lists page of the AspectJ web site.

Members of the AspectJ team are available to work with users in more depth on both program design and implementation issues. The team may also be able to provide speakers. Please contact the AspectJ team with your request.

3. How well does AspectJ integrate with existing Java development tools?

The AspectJ releases consists of extensions to standard Java tools, the AspectJ Development Environment (AJDE), and documentation.

AspectJ provides replacements for standard Java tools:

  • ajc, the AspectJ compiler, runs on any Java 2 compatible platform, and generates code that runs on either a Java 2 compatible platform, or a Java 1.1 compatible platform.

  • ajdb is an aspect-aware version of Java's jdb debugger.

  • ajdoc is a replacement for Sun's javadoc documentation tool that understands AspectJ's extensions.

The AspectJ Development Environment (AJDE) is integrated with or augments several common Java development environments. It brings to the aspect-oriented programmer the ability to navigate the aspect structure of their programs, just as object-oriented environments brought to object-oriented programmers the ability to navigate object relationships, i.e. the inheritance hierarchy.

The AspectJ Development Environment (AJDE) integrates with the following tools:

  • Borland's JBuilder (versions 4 and 5)

  • Sun Microsystems' Forte for Java (versions 2 and 3), as well as Netbeans 3.2

  • GNU Emacs (version 20.3) and XEmacs (version 21.1 on Unix and 21.4 on Windows)

4. What plans are there to support my IDE?

Support for other IDEs is not planned until after the 1.0 release. Our current efforts are focused on the stability, performance, and extensibility of the core AJDE support. The following IDEs are being considered for future support (mail us if you would like to add your IDE to this list or desire support for one of the IDEs listed below):

  • IBM's VisualAge for Java (integration with the 4.x version is not planned due to its very limited extensibility API)

  • VisualCafe

  • Together/J

  • Kawa

  • Visual SlickEdit

  • jEdit

5. Can I port AJDE support to my development environment?

Yes. The core AJDE API is extensible and the source code is available for download. Since porting documentation is limited, the best way to approach extending support is by studying the sources for the existing IDE support.

6. Is it safe to use AspectJ in my product plans?

You may use AspectJ in your product or project with little risk. Several factors play a role in reducing the risk of adopting this new technology:

  • AspectJ is an addition to Java, and can be added to a project in a way that limits risk. See Q: How do I start using AspectJ? for some suggestions on how to do this.

  • The AspectJ compiler accepts standard Java as input and produces standard Java bytecode as output. An optional mode produces standard Java 2 source code which may then be compiled with any compliant Java compiler, e.g. Sun's javac compiler or IBM's jikes compiler. The bytecode output will run on any standard Java 2 virtual machine.

  • AspectJ is available under the Mozilla Public License, a non-proprietary, open source license. This ensures that AspectJ will continue to evolve and be available, regardless of the fate of any particular organization involved with AspectJ.

  • Removing AspectJ from your program is not difficult, although you may lose valuable functionality that will need to be re-implemented in Java.

7. How is AspectJ licensed?

AspectJ is open-source software and is available under the Mozilla Public License. The documentation is available under a separate license that precludes for-profit or commercial redistribution.

8. How do I submit a bug report?

You can submit a bug using the web interface (preferred), or you may send email to support@aspectj.org.

4 Getting Help

1. How do I find out more about AspectJ?

You can contact the AspectJ team to find out more about AspectJ, or you may visit the AspectJ website.

2. How do I communicate with other AspectJ users?

You can reach other AspectJ users by using the aspectj-users mailing list. To subscribe to the list or view the list archives go to the user community page.

3. Can you recommend reading or teaching material for AspectJ?

The documentation available on this site is a primary source of material on AspectJ:

Selected AspectJ Papers and PresentationsPapers presented at various conferences; tutorial slide presentations.
Aspect-Oriented ProgrammingThe seminal AOP/AspectJ paper
The AspectJ Programming GuideA practical guide for programmers. Includes a number of examples, some quite sophisticated.
The AspectJ TutorialSlides from a day-long tutorial presentation on AspectJ.

5 Developing with AspectJ

1. What kind of IDE support is available for developing AspectJ programs?

2. Are aspect libraries available?

Some libraries are distributed in the release under the examples folder in the distribution. If you develop a library and want to make it available to other users, make sure to contact us.

3. How do I submit comments and feature requests?

You can contact the AspectJ team to submit comments and feature requests.

4. What Java virtual machine (JVM) do I use to run the AspectJ compiler?

Use the latest, greatest, fastest JVM you can get your hands on for your platform. The compiler's performance is dependent on the performance of the JVM it is running on, so the faster a JVM you can find to run it on, the shorter your compile times will be. At a minimum you need to use a Java 2 or later JVM to run the compiler. We realize that this constraint can be a problem for users who are running on Macintosh (until OS X in early 2001) and FreeBSD that don't currently have a Java 2 JVM available. We're sorry for the inconvenience, but we had to make the hard decision that the advantages of being able to rely on Java 2 were worth the cost of losing a number of developers who are working on platforms without Java 2 support. Here is a list of starting places where you might find support for your system.

The requirement of Java 2 support is only for running the AspectJ compiler. The AspectJ compiler can be used to build programs that will run on Java 1.1 (or probably even on Java 1.0) systems. This means that it can build programs that will run on Macintosh, FreeBSD, and applets that will run in Internet Explorer and Netscape Navigator that are still not yet Java 2 compliant.

5. Are there any issues using AspectJ with the Microsoft JVM?

Since AspectJ requires Java 2 or later, it will not run on the Microsoft JVM, which does not support Java 2.

6. How can I use ajc to compile programs for a JVM that is different from the one used to run it?

ajc can be used to develop programs that are targeted at the Java 1.1 platform, even though the ajc compiler won't run on that platform. Here's an example of using ajc in this sort of cross-compilation mode (assuming a Windows platform with all the default installation directories):

ajc -target 1.1 -bootclasspath c:\jdk1.1.7\lib\classes.zip \
   -classpath c:\aspectj0.7\lib\aspectjrt.jar \ -extdirs "" \
   -arglist jdk11system.lst

This same technique can be used if you want to run ajc on a JDK 1.3 JVM (highly recommended) but need to generate code for JDK 1.2. That would look something like:

ajc -bootclasspath c:\jdk1.2\jre\lib\rt.jar \
   -classpath c:\aspectj0.7\lib\aspectjrt.jar \
    -extdirs c:\jdk1.2\jre\lib\ext -arglist jdk12system.lst

7. How do I know which aspects affect a class when looking at that class's source code?

We have developed IDE support that gives programmers a clear and easy-to-use understanding of which aspects affect any class. This enables AspectJ programmers to get the benefits of modularizing crosscutting concerns while still having immediate access to what aspects affect a class.

See Q: How well does AspectJ integrate with existing Java development tools? for more information on which Java development environments are supported.

8. I have to list many files in the command line to compile with ajc. Is there any other way to provide the file names to ajc?

Yes, you can use the @ feature. Create a file called, for example, project, the contents of which consists of one filename per line. So it might look like:

OneClass.java
TwoClass.java
page/AClass.java
page/BClass.java
page/body/ThisClass.java
page/body/ThatClass.java

Then you can run the compiler as follows:

ajc @project

9. Is it necessary to compile all my source files with AspectJ if I use aspects?

No. You need only to compile with AspectJ the files that contains your aspects and the files that contain the classes that are affected by your aspect. See Q: How do I know which aspects affect a class when looking at that class's source code?.

6 AspectJ Design

1. It looks like aspects break the manifest interface of a class since they can access and modify all data members. Why did you make that decision?

In the spirit of Smalltalk, we have decided to give more power to the language in order to let the user community experiment and discover what is right. To date this has proven to be a successful strategy because it has permitted the construction of many useful aspects that crosscut the internal state of an object, and as such need access the its private members. However, we are not discounting that some sort of restrictions are useful, rather, we are seeking input from the community in order to decide on what these restrictions should be.

2. Are aspects always optional or non-functional parts of a program?

No. Although AspectJ can be used in a way that allows AspectJ code to be removed for the final build, aspect-oriented code is not always optional or non-functional. Consider what AOP really does: it makes the modules in a program correspond to modules in the design. In any given design, some modules are optional, and some are not.

The examples directory included in the AspectJ distribution contains some examples of the use aspects that are not optional. Without aspects,

beanPoint objects would not be JavaBeans.
introductionPoint objects would not be clonable, comparable or serializable.
spacewarNothing would be displayed.
telecomNo calls would be billed.

3. Are crosscutting concerns induced by flaws in parts of the system design, programming language, operating system, etc. Or is there something more fundamental going on?

AOP's fundamental assumption is that in any sufficiently complex system, there will inherently be some crosscutting concerns.

So, while there are some cases where you could re-factor a system to make a concern no longer be crosscutting, the AOP idea is that there are many cases where that is not possible, or where doing so would damage the code in other ways.

4. Does it really make sense to define aspects in terms of cross-cutting?

Yes.

The short summary is that it is right to define AOP in terms of crosscutting, because well-written AOP programs have clear crosscutting structure. It would be a mistake to define AOP in terms of "cleaning up tangling and scattering", because that isn't particular to AOP, and past programming language innovations also do that, as will future developments.

Slides for a long talk on this topic are at http://www.cs.ubc.ca/~gregor/vinst-2-17-01.zip.

5. Is AOP restricted to domain-specific applications?

No. Some implementations of AOP are domain-specific, but AspectJ was specifically designed to be general-purpose.

6. Can I use AspectJ with Generic Java?

At this time, unfortunately not. The two compilers are just not at all compatible. In an ideal world, there would be a wonderful Open Source extensible compiler framework for Java that both GJ and AspectJ would be built on top of, and they would seamlessly interoperate along with all other extensions to Java that you might be interested in, but that's not the case (yet?).

However, on 09 October 2000, the Java Community Process approved a proposal to add generic types to Java that is largely based on GJ (JSR 14). A draft specification was submitted for public review, which closed on 01 August 2001, and a prototype implementation has been released.

We are committed to moving very rapidly to add support for generic types in AspectJ when generic types become part of the Java language specification. Everyone on the AspectJ team is looking forward to this, because we too would really like to be able to write code that includes both aspects and generic types.

7 Technical Issues

1. What is the effect of using AspectJ on the source code size of programs?

Using aspects reduces, as a side effect, the number of source lines in a program. However, the major benefit of using aspects comes from improving the modularity of a program, not because the program is smaller. Aspects gather into a module concerns that would otherwise be scattered across or duplicated in multiple classes.

2. Are there any plans to incorporate the ability to perform AOP operations on existing Java bytecode (.class) files in addition to their source equivalents?

Yes, but not prior to the 1.0 release. If you have an application for using aspects and bytecode, please let the AspectJ team know of your requirements.

3. Does ajc rely on javac for generating Java bytecode (.class) files?

No. Some previous versions of AspectJ had this requirement, and javac can still be used as ajc back end by using the -usejavac flag. ajc is also able to run in preprocessor mode and generate Java source (.java) files that can then be fed through javac or another java compiler.

4. Does AspectJ add any performance overhead?

The issue of performance overhead is an important one. It is also quite subtle, since knowing what to measure is at least as important as knowing how to measure it, and neither is always apparent.

There is currently no benchmark suite for AOP languages in general nor for AspectJ in particular. It is probably too early to develop such a suite because AspectJ needs more maturation of the language and the coding styles first. Coding styles really drive the development of the benchmark suites since they suggest what is important to measure.

In the absence of a benchmark suite, AspectJ probably has an acceptable performance for everything except non-static advice. Introductions and static advice should have extremely small performance overheads compared to the same functionality implemented by hand.

If you'd like to measure the performance be sure to write code fragments in AspectJ and compare them to the performance of the corresponding code written without AspectJ. For example, don't compare a method with before/after advice that grabs a lock to just the method. That would be comparing apples and oranges. Also be sure to watch out for JIT effects that come from empty method bodies and the like. Our experience is that they can be quite misleading in understanding what you've measured.

8 AspectJ Administrivia

1. How do I download and install AspectJ?

Go to AspectJ's download web page and choose which components you want download. The jar files are installed by executing

java -jar jar file name

Do not try to extract the jar file contents and then attempt to execute java org.aspectj.Main. (A NoClassDefFoundError exception will be thrown.) The AspectJ distribution is not designed to be installed this way. Use the java -jar form shown above.

The compressed tar files (suffix: .tgz) are extracted by decompressing them with tar or with WinZip.

2. ajc is using the wrong JVM. How do I fix it?

The easiest way to fix this is to re-install ajc (using the same .class or .exe file that you originally downloaded) and this time make sure to tell it to use the desired JDK (typically the JDK versions 1.2 or 1.3 from Sun).

If you are familiar with DOS batch files or shell programming, you could also fix this by simply editing the bin\ajc.bat or bin/ajc script.

3. ajc complains that it can't find javac. What's wrong?

ajc does not try to locate javac in your path: it uses the javac classes directly. In JDK 1.2 and 1.3 these classes are found in tools.jar (in the lib directory of the JDK distribution), which you must include in your classpath in order to make ajc work with javac. You have to make sure that tools.jar is accessible on your classpath.

4. How do uninstall AspectJ?

The uninstall process for AspectJ only requires you to remove the files that the installer wrote in your file system. Delete the top-level installation directory (and all the files beneath it) that you specified when you installed AspectJ. On Windows, no registry settings were added or changed, so nothing needs to be undone.

5. The AspectJ compiler aborts with an out-of-memory error when compiling many classes. How can I fix this?

The command ajc is actually a script that launches a Java virtual machine with the correct classpath. You should make a copy of this script, rename it, and then edit it. Change the -Xmx option, size of memory allocation pool (heap). You might try -Xmx128M or even -Xmx256M.

9 The AspectJ Language

1. What are the differences between the current and previously released versions of AspectJ?

VersionDescription
AspectJ 1.0Many language changes, fixes, cleanup and clarifications, some significant.
AspectJ 0.8More cleanup of the syntax and semantics.
AspectJ 0.7Clean up of the semantics, 0.7 beta 4 is the first open source release.
AspectJ 0.6Advice and crosscuts get explicit type signatures which describe the values that are available to advice at a crosscut.
AspectJ 0.5Improved tool support: better Emacs environment support and ajdoc to parallel javadoc. around advice is added, and the aspect keyword is removed and replaced by the Java keyword class.
AspectJ 0.4Clear separation of crosscuts and crosscut actions makes it possible to define extensible library aspects.
AspectJ 0.3First all Java implementation, also includes many small language improvements.
AspectJ 0.2General-purpose support for crosscutting. Users could program any kind of aspects, not just coordination. This release dropped COOL.
AspectJ 0.1A single domain-specific aspect language, called COOL, for programming coordination in multi-threaded programs.

More detailed comments are available in the doc/changes.html file in the distribution.

2. What are join points?

Join points are well-defined points in the execution of a program. Not every execution point is a join point: only those points that can be used in a disciplined and principled manner are. So, in AspectJ, the execution of a method call is a join point, but "the execution of the expression at line 37 in file Foo.java" is not.

The rationale for restricting join points is similar to the rationale for restricting access to memory (pointers) or restricting control flow expressions (goto) in Java: programs are easier to understand, maintain and extend without the full power of the feature.

AspectJ join points include reading or writing a field; calling or executing an exception handler, method or constructor.

3. What is a pointcut?

A pointcut picks out join points. These joint points are described by the pointcut declaration. Pointcuts can be defined in classes or in aspects, and can be named or be anonymous.

4. What is advice?

Advice is code that executes at each in a join point picked out by a pointcut. There are three kinds of advice: before advice, around advice and after advice. As their names suggest, before advice runs before the join point executes; around advice executes before and after the join point; and after advice executes after the joint point. The power of advice comes from the advice being able to access values in the execution context of a pointcut.

5. What is an aspect?

Aspects are a new class-like language element that has been added to Java by AspectJ. Aspects are how developers encapsulate concerns that cut across classes, the natural unit of modularity in Java.

Aspects are similar to classes because...

  • aspects have type

  • aspects can extend classes and other aspects

  • aspects can be abstract or concrete

  • non-abstract aspects can be instantiated

  • aspects can have static and non-static state and behavior

  • aspects can have fields, methods, and types as members

  • the members of non-privileged aspects follow the same accessibility rules as those of classes

Aspects are different than classes because...

  • aspects can additionally include pointcuts; before, around and after advice; and introductions as members

  • aspects can be qualified by specifying the context in which the non-static state is available

  • aspects can't be used interchangeably with classes

  • aspects don't have constructors or finalizers, and they cannot be created with the new operator

  • privileged aspects can access private members of other types

6. Is it possible to introduce keywords (like synchronized) on methods?

It's not currently possible to introduce any keywords onto methods. However, for the case of synchronized in particular, we have what we consider a better solution that uses around advice instead of introduction. This solution is described in this thread on the AspectJ users list, with some additional comments.

7. How does ajc interact with the serialVersionUID?

The current version of ajc can change the serialVersionUID of generated .class files as a result of weaving in advice. This is an important fact that developers using both aspects and serialization should be aware of. It is likely that a future version of the compiler will be better behaved regarding the serialVersionUID.

However, changes to the serialVersionUID attribute are typically only important when using serialization for the long-term persistence of objects. Using standard Java serialization for long-term persistence has a number of drawbacks and many developers already use alternative solutions. For one possibly standard solution, see Long-Term Persistence for JavaBeans Specification .

10 About the AspectJ Project

1. What does the fact that AspectJ is an Open Source Project mean to me?

There are two philosophies in the Open Source community about when to do the first Open Source release of a system. One philosophy says "release early and release often". The current AspectJ source code release is based on that philosophy. This approach has the wonderful property of offering no excuses for delaying a release until things are "just right" which can often mean never releasing the source code at all.

The other philosophy says that you shouldn't make an Open Source release until the sources are relatively clean, and the core design of the system is relatively stable. This approach makes it much easier for outside developers to make significant contributions to the project. We believe that clean sources and a stable design is an admirable goal for any software project, but we don't want to delay making an Open Source release of AspectJ until we reach that point.

Instead we're just going to include this warning:

AspectJ is a new kind of programming language, and our understanding of how best to design a compiler for it is rapidly evolving. We plan to continually improve and frequently redesign the compiler as our understanding of AOP improves. We expect that the class hierarchies, method names, and fundamental design of the whole system will be significantly changing on a monthly or even weekly basis. No effort whatsoever will be spent at this point in the project to make new versions of the compiler even vaguely resemble a previous release in terms of internal design (Note: we will spend considerable effort to ensure that the compiler will behave in a consistent fashion externally to users of previous versions).

We expect this period of rapid development to end at some point. We'll be sure to announce it very clearly when we think the basic internal structure of the compiler is relatively stable and we believe it would be a reasonable platform for outside developers to look at and contribute to. Until we make that announcement, well, you've been warned.

So, given that warning, what good is the Open Source release?

  1. Knowing that the compiler for AspectJ will be Open Source when we get to version 1.0 is important. Building a significant system using a brand new emerging language is daring enough. Doing this without the knowledge that the source code is publicly available is too much to ask of many people. For this purpose, a promise to release AspectJ as Open Source as soon as we got to version 1.0 might be good enough; however, an actual release is always better than a promise.

  2. If people want to help us fix bugs, we certainly won't object. This can be valuable to our users in allowing them to fix some of their own bugs immediately rather than waiting for us to make a new release. It can also be valuable to us if people choose to include bug fixes with their bug reports.

  3. The code is out there. If you're doing a throw-away research project, then it might be useful even with our dire warnings about radical refactorings. If your project can afford to pick a single release of the source code to build on top of and not worry about keeping up with our bug fixes and improvements then the source code could be valuable to you even in its current rapidly changing state.

2. What are your plans to make AspectJ a general feature of Java supported by Sun and the other key-players in the Java Industry?

Although we are committed to making AspectJ available to a wide range of users, it is too early to decide on a strategy. Some options include continuing AspectJ as a stand-alone product, integrating it into IDEs, or possibly incorporating it into standard Java with Sun's blessing.

Our current focus is on getting a high-quality 1.0 release out. That release will stabilize the language and will include increased tool support. Shortly following the 1.0 release we intend to improve the AspectJ compiler in two directions: support for rapid incremental compilation and efficiency. We will also be releasing AspectJ-specific support for several popular IDEs.

Through all of this our goal is to make AspectJ integrate as seamlessly as possible with the Java programming language. The AspectJ language design is becoming more integrated, the compiler is becoming faster and more integrated, the IDE extensions are becoming more integrated. All of this is designed to help users really use AspectJ and give us feedback on it.

As more of the system is improved, and we get more feedback from users, we will be better positioned to explore the best path for long-term AspectJ support.

3. What is the AspectJ development schedule?

VersionDescription
1.0Final syntax and semantic changes. All known compiler bugs squashed. Bytecode compilation. Standalone structure browser. Complete documentation
1.1Faster incremental compilation
2.0New, dynamic crosscuts (bytecode-only)

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.