Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Question: for SmartInspect + AOP, do you recommend PostSharp or Unity?


#1

Hi,

I’d like to know whether

I have a large project with a log of classes, spread out over a few projects, some of them remote (i.e. WCF). The classes as are a mixture of static and non-static.

I’d like to add logging for method entry/exit to the project.

Would it be easier to use PostSharp or Unity to add SmartInspect logging using AOP?


#2

Hello Gravitas,

Thanks for your message. If you are mainly interested in AOP, I recommend trying out PostSharp. We have a ready-to-use PostSharp library for SmartInspect on our website here:

http://code.gurock.com/p/smartinspect-postsharp/

PostSharp implements the AOP functionality by simply specifying attributes for methods, classes or entire assemblies. Unity on the other hand requires that you instantiate all classes through their dependency injection framework in order to use the AOP functionality. As far as I know this also wouldn’t work with static classes.

I suggest taking a look at PostSharp and see how it works for you.

Thanks,
Dennis