Aspects in AspectJ

This is a pair programming assignment

Start with your code for the assignment composite ballot, chain for tally .

Add some logging and stats reporting features to your program using aspects in AspectJ.

  1. Download and install AspectJ from the Eclipse site. You can develop in Eclipse, or using a plain text editor and running "ajc" and "aj" (or "java") in a command line console window.

  2. Write aspects that will add logging to tell each time a vote is cast, and each time a vote is counted. You can "log" by writing to System.out.println if you like. Log each event as it happens.

  3. Write the aspects as separate file(s) of type .aj In this way you will not have to make any changes to your .java source files from the earlier assignment.

  4. Write aspects that will collect counts of all the yes votes and all the no votes separately. Also count how many total ballots are processed. When tallying is done write a report telling these totals.
    This means the output will be a lot of "voting" and "tallying" lines printed, and then at the end a summary report of totals.

  5. Submit the original java source files as well as the aspect sorce files on your assignment web page.