Hi. This is a question concerning AOP and .NET.
Here it is: is it possible to implement AOP concepts in .NET without inheriting from ContextBoundObject? Because this is a huge limitation, in my opinion...
Basically, concerns that cross-cut many of your classes, that you don't want to code more than once. Examples are logging, auditing, trace, performance timing etc. AOP provides 'pointcuts' that allow you to hook in at certain execution points in your code, e.g. method invocation. You can then execute some common function like auditing or logging at this point without having to put the code in your classes.
Personally I think it's a great way to handle non-functional requirements (like the examples above) but I feel that attempting to use it as a way to 'bolt on' functional requirements after a system is built will lead to a maintenance nightmare.
On the other hand, Stevexff is right about the maintenance, developing and debugging costs. Think that every method invocation is passed through a transparent proxy, a real proxy and a series of message sinks before the actual method code get executed...
I just was experimenting with the idea and found it interesting, except that every class needs to inherit ContextBoundObject, not to say the performance impact (due to context switches and the other operations described above).
Finally (after reading tons of articles written by both Microsoft people and thirt-parties) the conclusion is that the answer to my question is no...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.