<< Previous (Part 1)

Viewing crosscutting information

In this section you are going to use the Cross References view to see how your aspect advises your class. The cross references view shows crosscutting information and can also be used to navigate.

1.  Make sure that your World aspect is open in the editor, and check that Build Automatically is turned on from the Project menu.

2.  If the Cross References view is not already open, open it now. Select  Window > Show View > Other.... Expand the  AspectJ folder and select  Cross References. Click Finish to open the view.

3.  Select the aspect declaration in the editor and make sure that the Cross References view shows one advises relationship.

4.  Double click on the Hello.sayHello() method in the Cross References view. The Hello class will open in the editor with the sayHello() method highlighted. The cross references view has updated to show relationships for the new selection.


 

Advice markers

In this section you will use advice markers to navigate between advised and advising source locations.

1.  Make sure that the  World aspect is open in the editor. There should be one marker in the left hand margin.

2.  Right click on the marker. Select Advises > Hello.sayHello() to navigate to the advised method.

3.  The Hello class opens in the editor. There should be one marker in the left hand margin.

4.  Right click on this marker. Select Advised By > World.afterReturning(): greeting... to navigate to the advice in effect.

Using the Aspect Visualization perspective

In this section you will learn about the Visualiser views and the Aspect Visualization perspective.

1.  Open the Aspect Visualization perspective. Select  Window > Open Perspective > Other.... Select  Aspect Visualization then click Finish to open the perspective.

2.  Select the HelloWorld project in the Projects view.

3.  The Visualiser and Visualiser Menu views will update to show a graphical representation of the selected project, with crosscutting information represented by stripes on the bars.


<< Previous (Part 1)