zoukankan      html  css  js  c++  java
  • 让自己的框架实现缓存的功能



    在剥离的过程中,我去除了BackingStoreImplementations下的大部分,去除了Instrumentation的全部<用于做日志还有计数器之类用途的> 去除了原本必须依赖配置文件才能使用的。
    现在的功能只能依赖内存来作缓存,修改常量来影响缓存行为。
    但是不依赖配置文件,可以很达到简单的融入自己的框架。
    由于昨天没时间测试迁移的代码,所以没有发布代码
    目前只支持 AbsoulteTime SlidingTime NeverExpire方式的,至于FileDependency的需要自己集成一个Action,所以没做测试,也没去研究移植后的代码是否可行。
    https://files.cnblogs.com/wildfish/Caching.rar
    今天测试了一下,觉得没什么问题。
    顺便发布了测试代码
    using System;
    using System.Data;
    using NUnit.Framework ;
    using FishSky.SystemFrameWork.Caching;
    using FishSky.SystemFrameWork.Caching.Expirations;
    using FishSky.SystemFrameWork.Base;
    using FishSky.Data.Base ;
    using System.Threading;
    namespace FishSkyTest.SystemFrameworkTest
    {
        
    /// <summary>
        
    /// CachingTesting 的摘要说明。
        
    /// </summary>

        [TestFixture]
        
    public class CachingTesting
        
    {
            
    private CacheManager manager=CacheFactory.GetCacheManager();
            
    private static string KeyWordToStore1="KeyWordToStore1";
            
    private static string KeyWordToStore2="KeyWordToStore2";
            
    private static string KeyWordToStore3="KeyWordToStore3";
            
    private static string KeyWordToStore4="KeyWordToStore4";

            
    public CachingTesting()
            
    {
            
            }


            
    SetUp

            
    TestTimeSpanCacheAddRemove

            
    TestAbsoluteTime

            
    TestNeverExpired
        }

    }


  • 相关阅读:
    Microsoft Enterprise Library 5.0 系列(二) Cryptography Application Block (初级)
    Microsoft Enterprise Library 5.0 系列(五) Data Access Application Block
    Microsoft Enterprise Library 5.0 系列(八) Unity Dependency Injection and Interception
    Microsoft Enterprise Library 5.0 系列(九) Policy Injection Application Block
    Microsoft Enterprise Library 5.0 系列(三) Validation Application Block (高级)
    软件研发打油诗祝大家节日快乐
    从挖井的故事中想到开发管理中最容易忽视的几个简单道理
    ITIL管理思想的执行工具发布
    管理类软件设计“渔”之演化
    20070926日下午工作流与ITILQQ群 事件管理 讨论聊天记录
  • 原文地址:https://www.cnblogs.com/wildfish/p/315587.html
Copyright © 2011-2022 走看看