This file contains all of the information to handoff the DAJ project. -------------------------------------------------------------------- Known limitiations -------------------------------------------------------------------- o Can not handle zigzag in the traversal graph. Because DAJ generates code for each path in the traversal and it can not keep track of two different paths at the same time. Thus, DAJ would fail to traverse the object graph correctly in this case. -------------------------------------------------------------------- Future Additions to DAJ -------------------------------------------------------------------- o Proceed for around advices There are several ways of implementing it. The most sensible ways seems to be to add an around advice signiture to the recognized visitor advices with a subtraversal object and allow the user to call a method in that object. The object would be invoked during the traversal and the code for the class of the object should be generated during the traversal generation. The visitor method parsing needs to modified to add the new method signature, i.e. obtaining the class signature using java reflection. Then, generate the subtraversal for each traversal used with the advice. o Traversal through collections Allow the user to declare a data member as a java collection that would only contain certain object types. This would allow DAJ to generate code that would go iterate through the elements and continue the traversal. However, the traversal graph need to be modified in order to make this work since DAJ could possibily be connecting two disjoint traversal graphs. Add new syntax for the collection statement to the traversal file format. Handle the new connection in the traversal graph. Generate the code for each collection statement. Call the generated collection code for each traversal. o Packages added to the class graph Allow the user to add packages to a class graph in the traversal file. This involves adding new syntax to the traversal file format. For each package statement, look up the class graph object and call the method for the DJ ClassGraph that will add the nodes in a particular package to the class graph. -------------------------------------------------------------------- Minor Usability Options -------------------------------------------------------------------- o -d directory The option to specify the destination directory for the .class files. o -cp classpath The option to specify the class path that should be added during the process. Although there might be some complication due to 2 compilations and one execution. Thus, there possibily could be 3 different classpath options depending on the application. o options to execute only particular phases To execute upto and including each of the 4 steps for DAJ. It would be easy to add this feature from the aspectj.beh file. It has a method that calls each of the phases. -------------------------------------------------------------------- Core methods for DAJ source code -------------------------------------------------------------------- o DAJ.main - The main method that starts the parsing of the commandline options and the four phases in DAJ. o CommandLine.parse - Parse the commandline options and return a CommandLine object. o DAJ.generateTraversals - It calls each of the four phases. o CommandLine.generateStubs - Main call to generate stubs for the first compilation. o TraversalAspectList.generateStubs - For each file, DAJ will generate this object, i.e. a parse tree of the traversal file and generate appropriate stubs. o MyClassGraphListener.ClassGraphEvent - The method that gets called from CreateClassGraph.java that will start the traversal generation process. It parses command line arguments, parses the traversal file and calls TraversalAspectList.processClassGraphTraversals. o TraversalAspectList.processClasGraphTraversals - adaptive method for processing statements in a traversal file. It uses hastables to keep track of the current "environment" and processes the different statements. -------------------------------------------------------------------- Behavior Files -------------------------------------------------------------------- o ClassGraphListenerInterface.beh - As the name imply, it contains the interface for class graph listener. This is an implementation of the factory pattern and a listener pattern. It's a very simple interface. If you take a look at com1205 project description, it explains the interface in detail. o GenerateStubs.beh - It contains all behavior that pertains to generating stubs for the first compilation phase. o ProcessClassGraph.beh - Contains behavior for processing class graph statements and traversal statements. o ProcessTraversal.beh - It is part of the first software development phase. It contains code to just process the traversals. I believe that the accessor method in there is being used, but not the inlined visitor traversal. o cmdline_accessors.beh - It constains all behavior for accessing the data structure for command line options. Currently, I have a round about way of parsing the commandline. I couldn't figure out a way to use DemeterJ's parser generation facility to make it work. o cmdline_errors.beh - It contains most of the error checking for the command line options. Certain options must be listed in order for DAJ to process the files. o cmdline_genExeLines.beh - Contains code for generating the shell commands and their options for each of the four phases for DAJ. It extracts all the necessary information from the CommandLine object. o filelist.beh - Contains all utility methods for FileList. I use that as a collection of file lists. o streamforward.beh - Contains behavior for forwarding the output from the shell commands to the screen. It works most of the time. I have found that it isn't quite reliable. Don't know why yet. o visitor.beh - Contains code for processing visitor statements. It in effect "parses" the java reflection API to create a structure that stores the necessary information for generating code for a particular traversal. -------------------------------------------------------------------- Other files -------------------------------------------------------------------- o interf/AspectJTraversal.java - Contains the code that translates a DJ TraversalGraph object to AspectJ traversal code. It's in plain Java. I found that having this in a seperate .java file made it much easier to test the traversal generation process only. o ccg/CreateClassGraph.java - AspectJ code to intercept the main method, create a ClassGraph object and use the ClassGraphListener interface to start the traversal generation process.