开发者

Is it wise to use AppFabric + Postsharp for server side caching

开发者 https://www.devze.com 2023-03-27 13:52 出处:网络
One of开发者_JAVA百科 my friends wants to use AppFabric caching on server side (WCF services). But to reduce similar functionality across services code, he wants to cache data \"automatically\" using

One of开发者_JAVA百科 my friends wants to use AppFabric caching on server side (WCF services).

But to reduce similar functionality across services code, he wants to cache data "automatically" using AOP Postsharp + AppFabric cache.

Is it wise to use automatically caching in such style on server side?


The real question is: Does it make sense for your project? It is acceptable to automatically cache output from a method using aspects. It's less code you have to write and manage. Caching is a cross-cutting concern which is where AOP comes in. PostSharp is the leading AOP framework in the .NET world.

So, if you have code that does caching and you've tested it and it's proven then put it into an aspect and use it, then reuse it. It doesn't matter if it's local memory or app-fabric. If it makes sense then do it.

It's the same as you manually writing the code everytime, except you only need to write it once and PostSharp "writes" it for you where you tell it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号