mtelligent

View Original

Applied Aspect Oriented Programming with Dot Net

My presentation at code camp went very well yesterday. The turnout was pretty good for my session and I think it went well.  The topic with "Applied AOP" and I gave an overview of Aspect Oriented Programming and did code walk throughs with the Policy Injection Application Block, Spring.Net and Post Sharp.

My general recommendation is to look to implement AOP in your existing apps at service boundaries or on top of existing code that leverages dependency injection. If you are starting a green field application, and can really bake AOP into your architecture, then I think a compile time weaver like Post Sharp should be used.

I also think the the AOP concept aligns itself nicely with Domain Specific Languages and Domain Driven Design. When you describe the business domain, it may be natural to talk in terms of aspects that can be applied to your domain objects.

Here is a link to the code samples I used during the presentation. Included is the updated WCF IInstanceProvider I described in my last post as well as a custom matching rule that matches WCF operations based on the OperationContractAttribute.

Hopefully in the new year, I can make a resolution to get more involved in the community and post more on this very blog.