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?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend