This contains links to other instances of AspectJ sample code. It doesn't contain links to all articles that have AspectJ sample code, but arguably it should.

For a list of publications about AspectJ that might contain sample code, see the publications link off the AspectJ web site at http://eclipse.org/aspectj

AspectJ in Action by Ramnivas Laddad has sample code including four patterns: the worker object creation pattern, the exception introduction pattern, the participant pattern, and the wormhole pattern. Find the code at http://www.manning.com/laddad/.

In the OOPSLA 2002 paper Design Pattern Implementation in Java and AspectJ Jan Hannemann and Gregor Kiczales discuss the implementation in AspectJ of 23 of the traditional "gang of four" design patterns (from the book Design Patterns: elements of reusable object-oriented software by Gamma, Helm, Johnson, and Vlissides). Their paper and the code for those patterns are available from http://www.cs.ubc.ca/~jan/AODPs/ . The code is also available from the AspectJ web site as ubc-design-patterns.zip. The latest version is checked into the CVS repository along with other sample code at org.aspectj/modules/docs/sandbox/ubc-design-patterns. For instructions on downloading code from the CVS repository, see the FAQ entry "buildingsource".

The aTrack project aims to create an open source bug tracking application that demonstrates use of Aspect-Oriented Programming (AOP) with AspectJ. It uses AOP pragmatically to provide systematic support for technical, middleware, and business concerns.

The CricketCage project automatically creates JUnit TestCases for repeatable bugs and test scenarios. Include Cricket Cage's AspectJ code to install a code generator, then run the program to generate the TestCase.