How can I register without the pollution method?

I know about AOP and Postsharp, but the limitation here is that I cannot use postsharp, and using attributes for logging has overhead.

But again right now I have to put the log code in each method, copy a lot, and also is not part of the method. So my functions do more than one job. It does not look good when there is business logic and a magazine.

Be that as it may, how to make a class public and can add a log from the side of the class or function. Or I just need to go with the traditional way of logging.

Please let me know if any further information is needed. Any suggestion on a good / different way of logging is also welcome.

+5
source share
3 answers

Corporate library and unity. You can use composition to create magazine decorators around other classes, which are then registered and then transferred to another class.

Check out msdn.microsoft.com/en-us/magazine/gg490353.aspx

+1
source

You can create decorators for your classes, see http://en.wikipedia.org/wiki/Decorator_pattern

0
source

All Articles