文档详情

企业图书馆讲座系列6缓存应用程序块.ppt

发布:2017-07-03约2.44千字共49页下载文档
文本预览下载声明
Enterprise Library Caching Application Block;温故+知新;Patterns practices Architecture Guidance for the Enterprise;App Block History Feedback;Security;pp Enterprise Library;Enterprise Library 的定义;Enterprise的未来之路;今天的交流题目;有同感?;为什么需要Cache?;典型的应用场景;什么是缓冲应用程序块?;深入了解缓冲模块;Security;在您的应用配置文件中增加一个缓冲应用 为要创建的数据项创建 Cache manager 每一个子项需要有独立的名字 确定哪一个是默认的Cache manager;关于缓冲存储的几点建议;缓冲通常在内存中 还经常需要有后端存储 没有后端存储,是不容易实现持久化的 因此持久化存储是非常必要的 持久化的后端存储 当需要被缓冲的数据的生命周期中不可避免的需要经历进程或系统的重启时 支持使用隔离式存储和数据库方式(Data Access Application Block) 内容需要和缓冲一致(Rollback) 内容是从缓冲的初始化时装载到后端的;关于缓冲存储的几点建议(3);关于缓冲存储配置;如何加密? 需要 Cryptography Application Block 模块的支持 应该使用对称算法;创建默认 cache manager;增加条目;定义过期策略;基于时间的过期;基于时间的实例;变化时间的过期;支持的时间表达方法和示例;扩展时间应用范例;基于提醒机制的过期;配置过期表决的频率;条目移除提示;条目移除提示(2);类型要正确 一定要检查空值 (item not found in cache);装载缓冲;1:Create cache manager;后期装载的实例;何时使用主动装载(Proactive caching) 在一些情况下中,他们自己有更新周期。当装载到缓冲将导致状态过期的出现-You are using static or semistaticstate that has known update periods. If you use it in other scenarios, the state might expire before it is used. 此时,您需要清楚的知道被缓冲的对象的生命周期-You are using state with a known lifetime 您还需要提前知道占用资源的程度-You are using state of a known size. If you use proactive cache data loading when you do not know the size of the data, you might exhaust system resources. You must try to not use resources that you do not have. 使用不稳定的资源时,尽量多使用主动装载缓冲-You have problematic resources, such as a slow database, a slow network, or unreliable Web services. You can use this technique to retrieve all the state proactively, cache it, and work against the cache as much as it can. ;何时使用被动装载: 需要缓冲的对象状态过多或系统资源不足的情况-You are using lots of state and you do not have sufficient resources to cache all state for the entire application. 资源的可靠性和性能良好,此时被动装载的又是更明显-You are using reliable and responsive resources, such as a database, network, or Web service that will not impede application stability and performance. 希望利用缓冲机制,但是在应用程序的初始化时,希望不使用缓冲,而是根据用户输入等条件,进行缓冲-You are interested in caching data that is not available
显示全部
相似文档