chrido / nadvisor Goto Github PK
View Code? Open in Web Editor NEWRuntime Aspects based on Castle DynamicProxy, nice to use in combination with DI
License: BSD 3-Clause "New" or "Revised" License
Runtime Aspects based on Castle DynamicProxy, nice to use in combination with DI
License: BSD 3-Clause "New" or "Revised" License
####################################################################################################################### NAdivsor ####################################################################################################################### NAdvisor is a small library which adds Aspects during runtime. If you are looking for traditional Aspects have a look at postsharp.org The differences compared to traditional Aspects are: - Aspects can be instantiated, therefor can have dependencies in the constructor (fits very well with DI) - Pointcuts/Join Points can be changed during runtime - Aspects can have a different lifetime than theire intercepted classes. Some things which are difficult to do with compile time weaved Aspects but are trivial with NAdvisor: - unit testing with or without aspects - unit testing of your logic inside the aspects - JointPoints can be determined during runtime - because aspects are normal objects, they can be instantiated, they can have dependencies. - using Mocked aspects during unit tests - swap JointPoint definition during runtime (e.g. switching on/off performance measuring aspect) - no impact on build time - readable stacktraces Usage: //Instantiate a new SecurityAspect IAspect securityAspect = new SecurityAspect(user); //Creates a Proxy, chooses the Aspect from the List by the JointPointDefinition Advisor advisor = new Advisor(JointPointDefinition.AttributeBasedJointPointDefinition, new List<IAspect>() {securityAspect, loggingAspect}); //Gets a Proxy which is intercepted by the Securityaspect and Loggingaspect ISimpleService myService = advisor.GetAdvicedProxy<ISimpleService>(new SimpleService());
Make something like this possible:
var container = new Autofac.Builder.ContainerBuilder();
container.Register(c => new Service()).As().AdviceJointPoints(MyJointPointDefinition);
add reference implementation for a memoization aspect
Hi,
Make NAdvisor available through nuget package management system
http://nuget.codeplex.com/
Br
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.