I am currently looking at the AspectJ documentation, and I do not quite understand their Pointcut composition . In particular, I don’t understand what it does cFlow(P && Q)when the advice with this pointcut is executed.
A PowerPoint presentation (for a course at the University of Utrecht) I found an explanation
cflow is a collection of join points emanating from a slice of points argument. This means that cflow (P) && cflow (Q) is the intersection of two collections, while cflow (P && Q) means that you first merge pointcuts P and Q, and all the connection points resulting from this are in this collection.
They list all the join points for cFlow(P) && cFlow(Q)( pointcut flowPAndflowQ() : cflow(execution(* Example.P(..))) && cflow(execution(* Example.Q(..))) && within(Example);), and for me it looks like an intersection of all the control points of the stream of individual statements - P ∩ Q, if you will (as they said):
Stream from P-execution (void Example.P ())
Stream from P-call (void Example.Q ())
Stream from P-execution (void Example.Q ())
Stream from Q-execution (void Example.Q ( ))
Stream from P && stream from Q-execution (void Example.Q ())
(Their example is similar to that in AspectJ docs, except for the absence of the println () statement.)
What I (still) do not understand is what cFlow(P && Q)will do.
" , P, , Q, , "? , println() AspectJ: System.out.println("should not occur"); , P Q (.. P + Q), () P ∩ Q, P ∪ Q?
" P, Q", ..
X() ?
public void P() { X(); }
public void Q() { X(); }
public void X() { }
, AspectJ? (?)
, - .:)