Aspects and policy injection - clean up your code

Posted by Marcus Hammarberg on November 7, 2008
Stats

The other thing that really has impressed me this week was the use of policy injection and aspect oriented programming in our code.

I mean - you write aspects (or policies) for things like logging, performance counters, caching and error handling and move all that stuff into configurable policies. What is left in your code?

Pure and beautiful business code (or at least problem domain code).

It's so nice - we're cleaning up code every day in our project and I just love to remove logging and error handling from my code and see my business code emerge from the muddy waters of "cross cutting concerns".

This video opened my eyes for aspects. It's for PostSharp which is another framework for doing aspects, but the concepts are shown clearly.



Published by Marcus Hammarberg on Last updated