Simple use case: Input: Java application Traversal specification Output: Java application with traversal code added Java application is read by compiler and translated into *.class files Run application (without running main()! thanks to John's program) to produce class graph cg for Java application. Parse traversal file T.trv Get strategy s from T.trv Call John's program with cg and s to create AspectJ traversal code in file t.java. Call the newly created traversal in your Java application. Compile again without John's files but with the newly generated file t.java Run application Interface to AspectJTraversal: =============================================================== Write a class dictionary: ProcessTraversal.cd Write a file: ProcessTraversal.beh that contains a line like: AspectJTraversal ajt = new AspectJTraversal(cg, traversalName, strategy); You need to collect this information from your TraversalAspect-object that you created from the input file using the parser created from your class dictionary. Interface to CreateClassGraph: =============================================================== from: CreateClassGraph.java which is given to you: ClassGraphListener newCgListener = ClassGraphListenerFactory.getNew(); newCgListener.ClassGraphEvent(args, cg); The purpose of ClassGraphEvent(args, cg) is to do the work: To parse the traversal files mentioned in args, to build triples (cg, traversalName, strategy) and give them to the provided constructor for AspectJTraversal. This will create the traversal code. Motivation for: ClassGraphListener newCgListener = ClassGraphListenerFactory.getNew(); newCgListener.ClassGraphEvent(args, cg); This code is very robust. If you want to generate traversal code in a different way, this part will not change. You make ClassGraphListenerFactory.getNew() return a different object. This is an application of the "Factory Method" pattern.