code, defined by... PointCuts rules and patterns Attributes behaviors/appearance applied to... <Elements/> markup nodes in the source code, defined by... Selectors rules and patterns
{ // Applied to the same pointcut, the result will be // around1 { // before2 // around4 { // before5 // joinpoint // after3 // } // } // after4 } Ordering advices
makeNamed(Object namedObject) { return new NamedImpl(namedObject); } } class Foo { public void hello (){ Log.i("Hello", "My name is " + ((INamed) this).getName()); } }
must be as precise as possible ◎ Octopuss : arms reaching everywher Pointcuts matching unrelated joinpoints ◎ Asp’ception : because aspect is code too Pointcuts matching the advice itself ◎ Aspector Gadget : single responsibility SOLID principles apply to AOP as well