Let's take as an example a simple class which has a simple method:
Figure 1. A simple class which performs an action
package curam.mypackage;
public class MyEventSource {
public void doSomething() {
// do whatever it is that needs to be done
System.out.println("Do something!");
}
}
You decide that events should be raised:
before doSomething performs its logic (preDoSomething); and
after doSomething performs its logic (postDoSomething).