Aspect oriented programming (AOP)
.Net implementation
.Net implementation
What is Aspect-oriented Programming?
Manage and separate your own cross cutting concern from your business functionality.
Introduction
I’ve seen many different AOP frameworks implementations in .NET and most of them seems to me too complex to understand.
In this article i will introduce how to make AOP done in your solution.
MessageCallAspect and how does it work?
Wrap any module with TargetInspectorProxy, this will be your module context.
It creates a transparent proxy which will be your reference along the process.
The transparent proxy gets called for each method/ propery invocation of the target.
The transparent proxy serializes the call stack and passes that on to the TargetInspectorProxy.
The TargetInspectorProxy calls the message sink chain, the last one on the chain calls the actual target.
This sink chain is the actual interception on the method call processing. (also known as Aspect)
These aspects can be defined in two ways:
1. TargetInspectorProxy by his constructor.
2. Implement MessageSinkAttribute's and define them on method/propery/class
Project name: MessageCallAspect (beta of the beta but stable)
Project hosting: http://code.google.com/p/messagecallaspect/
useful links:
http://msdn.microsoft.com/en-us/magazine/cc164165.aspx