Master of Computer Science - University of Grenoble
Sara Bouchenak
Sara.Bouchenak@imag.fr http://sardes.inrialpes.fr/~bouchena/teaching/
ˇ Introduction Aspect-Oriented Programming and AspectJ programming language
ˇ Java programming
Install the required software libraries (AspectJ, Ant, MckoiDb): domwload
Configure the environment variables below:
JAVA_HOME
ASPECTJ_HOME
ANT_HOME
PATH (including JAVA_HOME/bin, ASPECTJ_HOME/bin, ANT_HOME/bin)
Copy the Java/AspectJ program examples: download
Online documentation
Test the example provided in Project/Examples/Hello
Original application
compilation: run ant compile
execution: un ant run
Extended application
compilation: un ant compile_aj
execution: un ant run_aj
Pointcuts
Test the example provided in Project/Examples/Tests
Write a new pointcut and an after advice for the execution of a constructor.
To test the program, add a constructor and an object creation to the provided application.
Declarations
Extend the example provided in Project/Examples/Tests to write new aspects for:
the declaration of warning messages printed at AspectJ compilation time
the declaration of error messages printed at AspectJ compilation time
Test the new aspects with the provided application.
Introductions
Extend the example provided in Project/Examples/Tests to write new aspects for:
the introduction of new attributes to a class
the introduction of new methods
the modification of the inheritence hierarchy of classes
Test the new aspects with the provided application.
cflow/cflowbelow
Extend the example provided in Project/Examples/Tests to write new aspects using:
cflow
cflowbelow
Test the new aspects with the provided application.
Passing context between pointcut and advice
Extend the example provided in Project/Examples/Tests to write new aspects to print:
the signature of the join point (method or constructor)
the parameters of the call
the object on which the call is performed
the result of the method or constructor
the thrown exception
Test the new aspects with the provided application.
thisJoinPoint and thisJoinPointStaticPart
Browse the API of the thisJoinPoint and thisJoinPointStaticPart interface (API)
Extend the example provided in Project/Examples/Tests to write new aspects to print:
information related to the join point
Test the new aspects with the provided application.
Other pointcuts
Extend the example provided in Project/Examples/Tests to write new aspects with:
pointcuts related to
method execution
constructor call
class initialization
read access to attributes
write access to attributes
exception handler
advice
before
after
around
Test the new aspects with the provided application.