You are on page 1of 1

aop

> cross cutting concerns - stuff done before and after a method : r
poss decorator, proxy pattern - but aop at runtime : v,d
modularize code, abstract out common stuff
eg of common stuff across classes. logging, metrics, performance monitoring, sec
urity
composition 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 a
nnotations : d
r: 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 it
before,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 spring
service
advice
means (depending on different implementations) : xml (see syntax), native aspect
j annotation
lombok, horizonte, hibernate
v : custom profiler , performance monitoring interceptor
stat obj stuff like min,max,avg time,#freq,methname
various interceptors (all proxy pattern)
consequence - readability
not poss : chaining like meth call in meth (if meth not in scope), private meth
- poss in some implementations
aspectj - has stuff for fields too, spring aop - only for meth
something to do with instrumentation, event based, simulation

You might also like