Domanda

I have been reading about (AOP) Aspect Oriented Programming and I could not find any good article on internet with its implementation in C#. Everyone are talking about AOP Frameworks.

The code the described in below reference is not working at all. http://www.codeproject.com/Articles/11387/Aspect-oriented-programming-in-NET-Part-II

Can someone share any good implementation code on aspect oriented programming? Or Else suggest a good AOP Framework to be implemented easily? As, we are in need to implement AOP in our Project for logging printing and sending mails on completion of specific operations.

È stato utile?

Soluzione

Have a look at PostSharp. It is a framework for AOP in .NET that is widely used. In contrast to other frameworks, it uses an approach that weaves the generated code into the intermediate language which is good for performance reasons.
On the website there are also lots of resources about AOP in general and how it can be used. There also is a free edition and a trial version.
However, if you need to only decorate some small portions of your code, using the Decorator pattern or something similar might also be an option.

Altri suggerimenti

http://www.codeproject.com/Tips/624586/Introducing-the-KingAOP-Framework-Part-1 seems to fit your need (I've not yet tested it though)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top