[[basics:intro|Intro]]
[[basics:ex1|Ex1]]
[[basics:ex2|Ex2]]
[[basics:ex3|Ex3]]
[[basics:ex4|Ex4]]
[[basics:ex5|Ex5]]
[[basics:ex6|Ex6]]
[[basics:ex7|Ex7]]
====== The Basics: Exercise 1 ======
Create an aspect named ''Basics'' with an auxiliary method ''output'':
public aspect Basics {
public void output(String tag, Object o) {
System.out.println(tag + ": " + o);
}
}
Next, add an advice to this aspect to prints a string just before the execution of the ''start()'' method. Use the following form for your advice:
before(): {
output("ex1","About to start");
}
You can employ the primitive pointcut ''execution(//Signature//)''. The signature pattern should at least specify the return type, the method name and the arguments.
Rerun the application to see the output from your aspect.
----
Continue with [[basics:ex2|Exercise 2]].