aop notes

Download Aop notes

If you can't read please download the document

Upload: shruthi

Post on 01-Oct-2015

213 views

Category:

Documents


1 download

DESCRIPTION

aop learning series notes

TRANSCRIPT

aop> cross cutting concerns - stuff done before and after a method : rposs decorator, proxy pattern - but aop at runtime : v,dmodularize code, abstract out common stuffeg of common stuff across classes. logging, metrics, performance monitoring, securitycomposition oriented ?- aspect - concern - functionality- joint pt where we can attach - pt where we can match something eg. method call eg.regex of method signature : name1|name2|name3 - could bloat so better use annotations : dr: adv of regex - neednt modify existing code ,dynamic,scope- pt cut - predicate where to match (eg method call is of this pkg, type - call graph - then apply this)- advice - what to attach, the functionality that you want to put itbefore,after,around- beginning and end,after exception then do log etc- weaving - advice, aop separated concern - mostly non business stuff - putting it together = weave, using stuff like springserviceadvicemeans (depending on different implementations) : xml (see syntax), native aspectj annotationlombok, horizonte, hibernatev : custom profiler , performance monitoring interceptorstat obj stuff like min,max,avg time,#freq,methnamevarious interceptors (all proxy pattern) consequence - readabilitynot poss : chaining like meth call in meth (if meth not in scope), private meth - poss in some implementationsaspectj - has stuff for fields too, spring aop - only for methsomething to do with instrumentation, event based, simulation