py-summer aop¶
Basic AOP functionality.
-
class
summer.aop.
AbstractMethodAdvice
(method: method)[source]¶ Base class for method advice.
If one wants to use the advice (ie. apply an aspect), the trick is to use the proxy class, that adds another layer of indirection.
Proxy delegates access to all the attributes to the target object. If the attribute is not decorated, proxy accesses the attribute directly.
Current implementation supports the creation of an advice in the proxy object by searching for a decoration – if the attribute (method) is decorated by particular decorator, new attribute with the same name is created on the proxy instance (of the type AbstractMethodAdvice) and it gets called instead, doing anything the aspect requires and than delegates the call to target object.