Using Python Decorators as Java-style Annotations Jeff Bauer
AspectJ - Before/After Output:
@AspectJ - Before/After Output:
Syntax Before/After Around def MyFunction(): def MyFunction(): --do something-- --do something-- @Before(<pointcut>) @After(<pointcut>) def MyAdvice(): def MyAdvice(proceed, *args, **kwargs): --apply adivce-- --apply adivce--
Implementation & Examples
Future Goals “this” and “target” keywords ● Access things other than what is passed in ○ Differentiate between call & execution ○ Applying multiple advices to one function ● ● Applying advice to different kinds of methods Global, Class, Static ○ Choosing functions to advise using RegExs ●
Questions?
Recommend
More recommend