Analysis Aspects

4
Analysis Aspects • Deters and Cytron propose to use analysis aspects to get profiling information from running Java programs. • We explore the design issues behind analysis aspects and show, by example, how to write an interesting aspect-oriented framework that measures bad coupling between objects/aspects.

description

Analysis Aspects. Deters and Cytron propose to use analysis aspects to get profiling information from running Java programs. - PowerPoint PPT Presentation

Transcript of Analysis Aspects

Page 1: Analysis Aspects

Analysis Aspects

• Deters and Cytron propose to use analysis aspects to get profiling information from running Java programs.

• We explore the design issues behind analysis aspects and show, by example, how to write an interesting aspect-oriented framework that measures bad coupling between objects/aspects.

Page 2: Analysis Aspects

Decoupling of Aspects

• Four aspects: Supplier, TargetBinStack, Checker and Statistics are an aspect-oriented framework.

• Customization is done by defining subaspects of Supplier and TargetBinStack.

• Decoupling of aspects is achieved through– abstract pointcuts and – Named, concrete pointcuts that are “exported”.

Page 3: Analysis Aspects

Instrumentation of Java programs with Aspects

Supplier

TargetBinStack

ReturnValueBin

ArgumentBin

GlobalPreferredBin

LocallyConstructedBin

ImmediatePartBin

Checker

StatisticsRequirements:

Good Separation of Concerns in Law of Demeter Checker

Aspect Diagram

uses pointcuts

http://www.ccs.neu.edu/home/lieber/com3205/f02/solutions/com3205/hw04/ (part 3)

Aspect framework

Page 4: Analysis Aspects

Explanation

• The *bin* aspects collect potential preferred supplier objects that represent good coupling in the context of a method body.

• The Checker aspect checks each method call whether the receiver is a preferred supplier object.

• The Statistics aspect counts events generated by the Checker aspect.