I have an ASP.NET 3.5 SP1 Webforms Application. I use the MVP pattern (supervising controller) with DI (autofac). My presenters call to the repository contracts defined in my Domain (DDD) which are implemented in an Infrastructure project.
The repository methods the presenters call can hork, so I need to log exceptions and then set an error message on the View.
In the past I would have added another parameter to the Presenter constructors, stored the reference in a Base Presenter, and called a Log method in my Catch blocks. I don't really like this, but it gets the job done.
I could go the route of using a factory to get the logging class as described here, but I'd like to explore AOP first, as it seems pretty interesting.
I have done the reading on compile-time vs runtime AOP, and I'd like to know what peoples' experiences are with the different solutions, pluses, minuses, words of advice, etc.
From the digging I have done it seems like there are 4 main frameworks for AOP in .NET
- Castle Windsor - I have stayed away from this in general because it does a whole lot of stuff I really don't need
- Spring.net - sounds like it has a good track record but inspires fear through its xml configuration (I don't like non-fluent configurations)
- PostSharp - Attribute driven (I like this) but at one point had some line number issues, not sure if they still exist
- Unity - a whole lot of stuff I don't really need
I see another question that has some good answers but its from a year and a half ago. Are there newer, "better", frameworks that have been developed in the meantime, or enhancements made to existing solutions that should be taken into consideration?
For reference, I chose Autofac for DI because its fluent, simple to use, couldn't find any negative comments about it, and it just works.
Are there recommendations on which AOP framework I should try? Thanks for reading all of this and for adding any thoughts.