AspectJ Demo Script - SDWest 2002
Talk Title: "Aspect-Oriented Software Development with AspectJ"
Demo time: 30 minutes
0. Overview
- Emacs
- At the declaration of the "spacewar.Ship.fire" method hit "<cntrl>x, <cntrl>j"
- Follow the resulting popup menu to the "EnsureShipIsAlive" advice
- Navigate back to "spacewar.Ship.fire" using the same method
- JBuilder
- Navigation
- In the "Structure View" select the "fire" method and expand it's
children to reveal "EnsureShipIsAlive: around..."
- Double-click "EnsureShipIsAlive: around..." to navigate to that advice
declaration
- Navigate back using the same method, or using the "Back", then
"Forward" method in conjuntion with the structure tree (this navigation
can also be done by right-clicking the inline advice icons in the editor's
gutter)
- Compilation
- In "EnsureShipIsAlive" remove "ship" from the "proceed(ship)" call and
recompile.
- When the error message pops up fix it by replacing "ship"
- Build Configuration
- Double-click "Default.lst" and select the "lst Designer" tab at the
bottom of the editor pane
- Expand the "spacewar" node
- Click "Debug.java" in order to add it to the configuration
- Navigate to the "Ship.java" class so that the effects of the new
compilation are visible in the "Structure View" when the compilation
completes
- Compile "Default.lst"
- Run the project (top the execution of the project by clicking the red
stop button in the run messages pane)
- NetBeans
- Crosscutting structure exploration.
- AJDoc
- Scroll down to the "fire" method, and follow it's "Advised by: " link to
get to the "EnsureShipIsAlive" aspect