Attribute-Based Caching and Unit Testing of Aspects

by Gael Fraiteur on 27 Oct 2010

There’s been some remarkable contributions from the community these last days; so let me write just a few words to introduce them.

Attribute-Based Caching

Adam Bell released an aspect library that addresses a single concern: caching. In Adam’s own words:

Cache expensive methods calls with a declarative attribute. No custom code required. Configure caching method using unity. Options include In-process and Out-Of-Process and Off. Out-Of-Process uses Microsoft ApplicationServer.Caching.

The project supports declarative cache invalidation. It is released under BSD license and hosted on CodePlex.

For more information about this project, read Adam’s blog.

Unit Testing of Aspects

Michael Collins blogged about implementing method tracing using log4net and PostSharp. Déjà vu? Wait. It’s true that tracing is the “hello world” example of AOP, but Michael gives us a production-ready implementation.

The most remarkable point of this post, for me, is that Michael shows us how to unit-test the aspects using a mocking framework. Very cool!

Many thanks to Adam and Michael for their great contributions!

Happy PostSharping!

-gael