using python decorators as java style annotations
play

Using Python Decorators as Java-style Annotations Jeff Bauer - PowerPoint PPT Presentation

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--


  1. Using Python Decorators as Java-style Annotations Jeff Bauer

  2. AspectJ - Before/After Output:

  3. @AspectJ - Before/After Output:

  4. 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--

  5. Implementation & Examples

  6. 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 ●

  7. Questions?

Recommend


More recommend