Package: b3j0f.aop
DescriptionThis project is an Aspect Oriented Programming library for python with reflective concerns.LinksHomepagePyPIDocumentationInstallationpip install b3j0f.aopFeaturesFree and unlimited access: no limits to sharing of ideas and knowledges with the license MIT.Performance:less memory consumption in using the __slots__ class property.less time on (un-)weaving and advice application improvement with binary python encoding and in using constants var in code.(dis/en)abling advices without remove them in using dedicated Advice class.Easy to use:joinpoint matching with function or regex.distributed programming:interception context sharing in order to ease behaviour sharing between advices.uuid for advice identification in order to ease its use in a distributed context.maintenable with well named variables and functions, comments and few lines.extensible through pythonic code (PEP8), same logic to function code interception and concern modularisation with one module by joinpoint or advice.respect of aspects vocabulary in order to ease its use among AOP users.close to callable python objects in weaving all types of callable elements such as (built-in) functions, (built-in) class, (built-in) methods, callable objects, etc.advices are callable objects.Unit tests for all functions such as examples.Benchmark:speed executionLimitationsDo not weave advices on readonly instance methods (where class use __slots__ attribute).ExamplesHow to change the behaviour of min by max ?>>> from b3j0f.aop import weave, is_intercepted
>>> double_advice = lambda joinpoint: joinpoint.proceed() * 2
>>> weave(target=min, advices=double_advice)
>>> min(6, 7)
12How to check if a function is intercepted ?>>> from b3j0f.aop import is_intercepted
>>> is_intercepted(min)
TrueOk, let’s get back its previous behaviour …>>> from b3j0f.aop import unweave
>>> unweave(min)
>>> min(6, 7)
6
>>> is_intercepted(min)
FalseAnd with an annotation ?>>> from b3j0f.aop import weave_on
>>> weave_on(advices=double_advice)(min)
>>> min(6, 7)
12
>>> is_intercepted(min)
True
>>> unweave(min)  # do not forget to unweave if weaving is useless ;)Enjoy …State of the artRelated to improving criteria points (1. Free and unlimited access, etc.), a state of the art is provided here.LibraryUrlLicenseExecutionUseBenchmarkCompatibilityb3j0f.aophttps://github.com/b3j0f/aopMIT4/54/54/54/5 (>=2.6)pyaspectshttp://tinyurl.com/n7ccof5GPL 24/52/52/52/5aspectshttp://tinyurl.com/obp8t2vLGPL 2.12/52/52/52/5aspecthttp://tinyurl.com/lpd87bdBSD2/51/51/51/5springhttp://tinyurl.com/dmkpj3Apache4/52/53/52/5pytilitieshttp://tinyurl.com/q49ulr5GPL 31/51/51/51/5pyaspectsweaknessesNot functional approach: Aspect class definition.Side effects: Not close to python API.Not optimized Weaving and Time execution: use classes and generic methods.Not maintenable: poor comments.open-source and use limitations: GPL 2.limited in weave filtering.aspectsweaknessesopen-source and use limitations: LGPL 2.1.more difficulties to understand code with no respect of the AOP vocabulary, packaged into one module.limited in weave filtering.aspectstrengthsinvert the AOP in decorating advices with joinpoint instead of weaving advices on joinpoint.open-source and no use limitations: BSD.weaknessesSimple and functional approach with use of python tools.maintenable: commented in respect of the PEP8.limited in weave filtering.springstrengthsa very powerful library dedicated to develop strong systems based on component based software engineering.unittests.huge community.weaknessesrequire to understand a lot of concepts and install an heavy library before doing a simple interception with AOP concerns.pytilitiesstrenghtsVery complex and full library for doing aspects and other things.weaknessesopen-source and use limitations: GPL 3.not maintenable: missing documentations and not respect of the PEP8.Executon time is not optimized with several classes used with generic getters without using __slots__. The only one optimization comes from the yield which requires from users to use it in their own advices (which must be a class).Perspectiveswait feedbacks during 6 months before passing it to a stable version.Cython implementation.Donation