Aspect-oriented programming and / or Enterprise Library 5.0 to implement registration / exclusion?

I can implement both AOP (using Postsharp) and EntLib (v5.0) for cross-cutting tasks as logging and exception / strategy handling.

I don’t see if someone else excludes or where they can complement each other. Can someone please share your experience and / or thoughts on this?

Thanks!

I take it for exceptions:

AOP can easily wrap your code and catch exceptions. Processing can then be delegated to EntLib, which provides strong processing (wrapping, replacing, swallowing) using policies.

Processing strategies (wrapping, replacing, and swallowing) can also be implemented in aspects. What will decide? Or am I missing something here?

+4
source share
1 answer

I have not used Enterprise Lib, so let me talk in terms of log4net and postsharp.

Log4net has great entries, and you can use AOP (using postsharp) to do this logging in a declarative way. In that sense, they are great compliments.

Here is an example. I would expect this to be true for Enterprise Library-based journaling or exception handling.

What I would not suggest you use are two things like AOP together, so injecting a policy into the Enterprise Library looks like AOP to me, so I won’t use it and postsharp either.

+4
source

All Articles