Archive

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

Comments (3) -

Pierre
Pierre
10/28/2010 12:30:34 PM #

Cool, but there already was http://aopcachingcomponents.codeplex.com.

It supports "cache singletons" (an object in cache can be identified by different keys (not only the parameter that is passed to a specific cache method). Exemple: public SomeExpensiveObject GetExpensiveObject(Guid userId) returns the same as GetExpensiveObject(String userName), which would result in this case in storing two times the same object in cache.

Cache singletons avoid storing two different objects for these methods' return values. A user is stored uniquely (less storage, esaier for cache invalidation).

Also supports lazy loading.

Cache invalidation is not implemented (for the moment) in aopcachingcomponents though.

Gael Fraiteur
Gael Fraiteur
10/28/2010 12:53:22 PM #

Hi Pierre,

Great! I did not know it.

I see it's linked to PostSharp 1.0. Would you port it to PostSharp 2.0 so I can index it?

-gael

Pierre
Pierre
10/29/2010 9:41:18 AM #

Great idea, though I haven't focused much on Postsharp 2 until now. I'll try to do that in the next couple of days.

Pingbacks and trackbacks (2)+

Comments are closed