歡迎來(lái)到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁(yè) 裝配圖網(wǎng) > 資源分類 > PPT文檔下載  

企業(yè)庫(kù)系列講座:緩存應(yīng)用程序塊.ppt

  • 資源ID:5176045       資源大?。?span id="rrnggxb" class="font-tahoma">2.85MB        全文頁(yè)數(shù):49頁(yè)
  • 資源格式: PPT        下載積分:9.9積分
快捷下載 游客一鍵下載
會(huì)員登錄下載
微信登錄下載
三方登錄下載: 微信開(kāi)放平臺(tái)登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要9.9積分
郵箱/手機(jī):
溫馨提示:
用戶名和密碼都是您填寫的郵箱或者手機(jī)號(hào),方便查詢和重復(fù)下載(系統(tǒng)自動(dòng)生成)
支付方式: 支付寶    微信支付   
驗(yàn)證碼:   換一換

 
賬號(hào):
密碼:
驗(yàn)證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會(huì)被瀏覽器默認(rèn)打開(kāi),此種情況可以點(diǎn)擊瀏覽器菜單,保存網(wǎng)頁(yè)到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請(qǐng)使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無(wú)水印,預(yù)覽文檔經(jīng)過(guò)壓縮,下載后原文更清晰。
5、試題試卷類文檔,如果標(biāo)題沒(méi)有明確說(shuō)明有答案則都視為沒(méi)有答案,請(qǐng)知曉。

企業(yè)庫(kù)系列講座:緩存應(yīng)用程序塊.ppt

November2004 EnterpriseLibraryCachingApplicationBlock 莫淘ArchitectEvangelistDevelop PlatformEvangelismMicrosoft China November2004 溫故 知新 什么是Patterns practicesApplicationBlock的發(fā)展 November2004 Patterns practicesArchitectureGuidancefortheEnterprise ReferenceArchitectures ApplicationBlocks GuidesGuidanceforbroadhorizontaltopicssuchassecurity performance deploymentandoperations Patterns D A D I A D I Atomicsolutionstorecurringproblems Sub system levelguidanceforcommonservices System levelguidanceforcommoncustomerscenarios D A D I A D I Availableonline ProvenBasedonfieldexperienceAuthoritativeOfferthebestadviceavailableAccurateTechnicallyvalidatedandtestedActionableProvidethestepstosuccessRelevantAddressreal worldproblemsbasedoncustomerscenarios Factory Plugin Enterpriselibrary Indigo November2004 AppBlockHistory Feedback 發(fā)展歷史 History 應(yīng)用程序塊 Applicationblocks 已經(jīng)誕生多年在Microsoft內(nèi)部 程序塊產(chǎn)生在不同的設(shè)計(jì)組中 并演化了多年程序塊涉及的范圍verysimplehelperspowerfulframeworkslikeUIP幾點(diǎn)共識(shí)降低項(xiàng)目成本增加解決方案的可用性業(yè)界反饋 Feedback 提供了程序塊的一致性提供了模塊之間更少的依賴性O(shè)notherblocksOninfrastructure更容易的配置易用性 November2004 Security Crypto Configuration DataAccess Logging Caching Exceptions EnterpriseLibraryv1總體架構(gòu) Legend Dependency Plug in ConfigTool November2004 EnterpriseLibraryVision Partnerblocks Customerblocks Communityblocks p pblocks BlockSpecification November2004 EnterpriseLibrary的定義 EnterpriseLibrary是 是面對(duì)一些企業(yè)級(jí)應(yīng)用開(kāi)發(fā)中常見(jiàn)的問(wèn)題的解決方案庫(kù) libraryofapplicationblockswhichsolvecommonchallenges 是一系列可以工作在任何架構(gòu)下的幫助類 Asetofhelperclasseswhichworkinanyarchitecturalstyle 是體系架構(gòu)上的指導(dǎo)性文件 Architecturalguidanceembodiedincodewhichshipswithfullsourceallowingyoutomodifyandextend 是免費(fèi)的 Availableasafreedownload EnterpriseLibrary不是 不是 Net架構(gòu)中的一部分 Apartofthe NETFramework 不對(duì)任何體系架構(gòu)后依賴或影響關(guān)系 Anapplicationframeworkthatimposesanarchitecturalstyle 不是一種官方支持的產(chǎn)品 AMicrosoftproductwithsupport compatibilityandlocalization 不用于銷售 Forsale November2004 Enterprise的未來(lái)之路 微軟將一如既往的在改領(lǐng)域進(jìn)行投入 Wewillcontinuetoinvestinblocksandblocklibraries 將不斷的擴(kuò)展 升級(jí)該方案庫(kù) Additionalcapabilitiesandscenarios Newblocks suchasValidationUpdatingexistingapplicationblocks suchasUIPScenariossuchasSmartClient融入其他的產(chǎn)品 Enablement VisualStudiotoolingandwizardsDeepercommunitypenetration會(huì)出現(xiàn)在新的 NET2 0 Whidbey上的方案BlocksrevvedtoadheretobestpracticesofnewplatformIntegrationwithnewVS2005experiences November2004 今天的交流題目 Patterns practices中關(guān)于緩沖的指導(dǎo)意見(jiàn)關(guān)于CachingApplicationBlock應(yīng)用場(chǎng)景和設(shè)計(jì)指南的描述應(yīng)用示例問(wèn)題解答 November2004 有同感 用戶抱怨系統(tǒng)的性能您已經(jīng)將明年的預(yù)算花在如何擴(kuò)展現(xiàn)有的數(shù)據(jù)庫(kù)服務(wù)器的吞吐能力上了您的應(yīng)用程序在沒(méi)有和后端的數(shù)據(jù)源連接時(shí) 程序不能夠執(zhí)行或執(zhí)行的很不好 November2004 為什么需要Cache 性能采用一種更為密切的方式 為數(shù)據(jù)的消費(fèi)者存儲(chǔ)相關(guān)的數(shù)據(jù) 以避免重復(fù)性的數(shù)據(jù)創(chuàng)建 處理和傳輸 可擴(kuò)展性避免在相同的數(shù)據(jù)處理和業(yè)務(wù)邏輯上浪費(fèi)資源 減小數(shù)據(jù)庫(kù)的請(qǐng)求 以便允許更多的客戶訪問(wèn) 可用性在另外的地方存儲(chǔ)數(shù)據(jù) 您的應(yīng)用能夠在網(wǎng)絡(luò)的的延時(shí) WEB服務(wù)和硬件的問(wèn)題中減小損失 November2004 典型的應(yīng)用場(chǎng)景 提問(wèn) 以前不是有緩沖嗎 System Web Cache回答 全面性 易用性 一致性 您正在使用本地的緩沖創(chuàng)建智能客戶端應(yīng)用使用緩沖功能 支持離線應(yīng)用您正在創(chuàng)建WINDOWS服務(wù)或者控制臺(tái)應(yīng)用 并且需要使用緩沖改善性能 November2004 什么是緩沖應(yīng)用程序塊 提供了一些方便易用的 可擴(kuò)展的緩沖機(jī)制 這些緩沖機(jī)制可以使用在整體應(yīng)用中的各個(gè)層面 支持后期存儲(chǔ) 支持的存儲(chǔ)方式包括數(shù)據(jù)庫(kù)方式和獨(dú)立存儲(chǔ)方式 Isolatedstorage 便于應(yīng)用方便的重新啟動(dòng)便于使用便于配置支持使用配置工具線程安全可以確保在內(nèi)存中的緩沖和后端存儲(chǔ)保持同步 November2004 深入了解緩沖模塊 如何創(chuàng)建緩沖配置文件選擇后端存儲(chǔ)創(chuàng)建緩沖向緩沖中添加一項(xiàng)設(shè)置過(guò)期策略從緩沖中獲得一項(xiàng)內(nèi)容緩沖裝載策略從緩沖中移除一項(xiàng)刷新緩沖關(guān)鍵特性 November2004 Security Crypto Configuration DataAccess Logging Caching Exceptions CacheAB所處的地位 Legend Dependency Plug in ConfigTool November2004 在您的應(yīng)用配置文件中增加一個(gè)緩沖應(yīng)用為要?jiǎng)?chuàng)建的數(shù)據(jù)項(xiàng)創(chuàng)建Cachemanager每一個(gè)子項(xiàng)需要有獨(dú)立的名字確定哪一個(gè)是默認(rèn)的Cachemanager 創(chuàng)建配置文件 November2004 關(guān)于緩沖存儲(chǔ)的幾點(diǎn)建議 內(nèi)存駐留型緩沖的典型應(yīng)用 應(yīng)用程序經(jīng)常使用同樣的數(shù)據(jù)一個(gè)應(yīng)用程序經(jīng)常需要重新獲得數(shù)據(jù)磁盤駐留型緩沖的典型應(yīng)用 數(shù)據(jù)量比較大同時(shí) 從應(yīng)用服務(wù)提供商 例如數(shù)據(jù)庫(kù) 重新獲取數(shù)據(jù) 開(kāi)銷比較大在緩沖的生命周期中 必須經(jīng)歷系統(tǒng)的重新啟動(dòng) CachingArchitectureGuidefor NETFrameworkApplications November2004 緩沖通常在內(nèi)存中還經(jīng)常需要有后端存儲(chǔ)沒(méi)有后端存儲(chǔ) 是不容易實(shí)現(xiàn)持久化的因此持久化存儲(chǔ)是非常必要的持久化的后端存儲(chǔ)當(dāng)需要被緩沖的數(shù)據(jù)的生命周期中不可避免的需要經(jīng)歷進(jìn)程或系統(tǒng)的重啟時(shí)支持使用隔離式存儲(chǔ)和數(shù)據(jù)庫(kù)方式 DataAccessApplicationBlock 內(nèi)容需要和緩沖一致 Rollback 內(nèi)容是從緩沖的初始化時(shí)裝載到后端的 關(guān)于緩沖存儲(chǔ)的幾點(diǎn)建議 2 November2004 關(guān)于緩沖存儲(chǔ)的幾點(diǎn)建議 3 隔離式存儲(chǔ)支持基于用戶和程序集的隔離機(jī)制不需要UniquePath了避免HardCodeCachingApplicationBlock提供了分區(qū)機(jī)制 在一個(gè)應(yīng)用程序中 并存多個(gè)cachemanagers不支持 也不應(yīng)該支持多個(gè)由多個(gè)Cachemanager共享存儲(chǔ)或分區(qū) November2004 關(guān)于緩沖存儲(chǔ)配置 緩沖還要加密 內(nèi)存溢出 木馬程序 DataAccessApplicationBlock利用數(shù)據(jù)庫(kù)實(shí)例進(jìn)行分區(qū)的命名和數(shù)據(jù)的分離需要數(shù)據(jù)庫(kù)訪問(wèn)模塊 DAAB 的支持 November2004 如何加密 需要CryptographyApplicationBlock模塊的支持應(yīng)該使用對(duì)稱算法 關(guān)于緩沖存儲(chǔ)配置 2 November2004 創(chuàng)建默認(rèn)cachemanager 典型用法 CacheManagermyCache CacheManager GetCacheManager 創(chuàng)建命名的cachemanager CacheManagerproductsCache CacheManager GetCacheManager Products November2004 增加條目 默認(rèn)的增加一個(gè)條目 productsCache Add ProductID123 productObject 默認(rèn)值清除優(yōu)先級(jí) Normal過(guò)期設(shè)置 Noexpiration注意增加第二個(gè)同樣KEY值的條目 會(huì)替換掉第一個(gè)當(dāng)希望使用后端存儲(chǔ)時(shí) 對(duì)象應(yīng)該支持序列化 November2004 定義過(guò)期策略 基于時(shí)間的過(guò)期設(shè)置過(guò)期時(shí)間支持兩種 相對(duì)時(shí)間絕對(duì)時(shí)間對(duì)于使用那些變化比較大的數(shù)據(jù) 例如經(jīng)常被更新的數(shù)據(jù)或只在一段時(shí)間內(nèi)存在的數(shù)據(jù)時(shí) 建議存在在緩沖中基于提醒的過(guò)期 且支持策略對(duì)該資源屬性的更改 對(duì)應(yīng)的提醒 Suchasafile afolder oranyothertypeofdatasource 只是Remove November2004 基于時(shí)間的過(guò)期 絕對(duì)時(shí)間 Absolute 允許您定義緩沖項(xiàng)的生命周期簡(jiǎn)單的方法 指定一個(gè)特定的時(shí)間作為過(guò)期擴(kuò)展方法 您可以通過(guò)表達(dá)式定義EveryminuteEverySunday15thofEverymonth 變化的時(shí)間允許您定義針對(duì)條目的被調(diào)用的兩次之間的間隔 定義條目的生命周期 November2004 基于時(shí)間的實(shí)例 DateTimerefreshTime newDateTime 2005 3 21 2 0 0 AbsoluteTimeexpireTime newAbsoluteTime refreshTime primitivesCache Add Key1 CacheItem1 CacheItemPriority Normal null expireTime 需要使用ADD方法CachingApplicationBlock支持基于時(shí)間的表達(dá)式AbsoluteTimeSlidingTimeExtendedFormatTime例如 expireat2 00AMon3 21 05 November2004 變化時(shí)間的過(guò)期 TimeSpanrefreshTime newTimeSpan 0 5 0 SlidingTimeexpireTime newSlidingTime refreshTime primitivesCache Add Key1 CacheItem1 CacheItemPriority Normal null expireTime 例如 被訪問(wèn)5分鐘后 November2004 支持的時(shí)間表達(dá)方法和示例 Extendedtimeformat meansruneveryperiodExamples expireseveryminute 5 expire5thminuteofeveryhour 21 expireeveryminuteofthe21sthourofeveryday 3115 expire3 31PMeveryday 74 6 expireSaturday4 07AM 152147 expire9 15PMon4July November2004 擴(kuò)展時(shí)間應(yīng)用范例 ExtendedFormatTimeexpireTime newExtendedFormatTime 00 6 primitivesCache Add Key1 CacheItem1 CacheItemPriority Normal null expireTime 擴(kuò)展時(shí)間應(yīng)用范例 expireatmidnighteverySaturday November2004 基于提醒機(jī)制的過(guò)期 FileDependencyexpireNotice newFileDependency Trigger txt productsCache Add Key1 CacheItem1 CacheItemPriority Normal null expireNotice 文件依賴的例子 expireifthefileTrigger txtischanged 您可以創(chuàng)建自己的過(guò)期類 只需要實(shí)現(xiàn)ICacheItemExpiration接口 November2004 配置過(guò)期表決的頻率 通過(guò)后臺(tái)線程 BackgroundScheduler 移除過(guò)期事項(xiàng)您可以對(duì)次線程進(jìn)行配置過(guò)高 CPU浪費(fèi) 且CACHE沒(méi)有起到作用過(guò)低 內(nèi)存消耗太大建議使用性能計(jì)數(shù)器監(jiān)視一下 November2004 條目移除提示 productsCache Add Key1 CacheItem1 CacheItemPriority Normal newProductCacheRefreshAction expireNotice CachingApplicationBlock提供了項(xiàng)目移除的提醒 并在一下情況下被激活條目過(guò)期了條目被顯式的移除了條目被策略的清楚了需要實(shí)現(xiàn)ICacheItemRefreshAction接口 November2004 條目移除提示 2 Serializable publicclassProductCacheRefreshAction ICacheItemRefreshAction publicvoidRefresh stringkey objectexpiredValue CacheItemRemovedReasonremovalReason Itemhasbeenremovedfromcache Performdesiredactionshere basedupontheremovalreason e g refreshthecachewiththe item 一個(gè)類實(shí)現(xiàn)了ICacheItemRefreshAction接口 同時(shí)如果需要后端存儲(chǔ)時(shí) 還必須被標(biāo)識(shí)為Serializable Especiallyforpersistentbackingstore November2004 類型要正確一定要檢查空值 itemnotfoundincache 從Cachemanager中獲取 publicProductReadProductByID stringproductID Productproduct Product cache GetData productID if product null Itemnotincache 類型轉(zhuǎn)換 檢查空值 November2004 裝載緩沖 緩沖的前期裝載 Proactiveloading 應(yīng)用啟動(dòng)時(shí)裝載優(yōu)點(diǎn)全部裝載后 應(yīng)用運(yùn)行性能提升明顯缺點(diǎn)啟動(dòng)時(shí)間長(zhǎng)可能帶來(lái)不必要的資源浪費(fèi)為了提升啟動(dòng)性能而進(jìn)行的 基于不同線程的裝載 有造成了應(yīng)用結(jié)構(gòu)的復(fù)雜性緩沖的被動(dòng)裝載 Reactiveloading 按需裝載優(yōu)點(diǎn)只有在需要的時(shí)候才裝載 對(duì)資源的需求小缺點(diǎn)但是在首次裝載的時(shí)候 速度慢 November2004 1 Createcachemanager 主動(dòng)裝載的實(shí)例 CacheManagerproductsCache CacheManager GetCacheManager RetrievethedatafromthesourceArrayListlist dataProvider GetProductList Addalltheitemstothecachefor inti 0 i list Count i Productproduct Product list i productsCache Add product ProductID product 2 Additemsduringcomponentinitialization November2004 后期裝載的實(shí)例 Productproduct Product productsCache GetData productID if product null Retrieveitfromthedataprovider andcacheitformorerequests product dataProvider GetProductByID productID if product null productsCache Add productID product 1 Createcachemanager CacheManagerproductsCache CacheManager GetCacheManager 2 Additemswhenretrievedfromdatasource November2004 何時(shí)使用主動(dòng)裝載 Proactivecaching 在一些情況下中 他們自己有更新周期 當(dāng)裝載到緩沖將導(dǎo)致?tīng)顟B(tài)過(guò)期的出現(xiàn) Youareusingstaticorsemistaticstatethathasknownupdateperiods Ifyouuseitinotherscenarios thestatemightexpirebeforeitisused 此時(shí) 您需要清楚的知道被緩沖的對(duì)象的生命周期 Youareusingstatewithaknownlifetime您還需要提前知道占用資源的程度 Youareusingstateofaknownsize Ifyouuseproactivecachedataloadingwhenyoudonotknowthesizeofthedata youmightexhaustsystemresources Youmusttrytonotuseresourcesthatyoudonothave 使用不穩(wěn)定的資源時(shí) 盡量多使用主動(dòng)裝載緩沖 Youhaveproblematicresources suchasaslowdatabase aslownetwork orunreliableWebservices Youcanusethistechniquetoretrieveallthestateproactively cacheit andworkagainstthecacheasmuchasitcan 最佳實(shí)踐 Cache主動(dòng)裝載 November2004 何時(shí)使用被動(dòng)裝載 需要緩沖的對(duì)象狀態(tài)過(guò)多或系統(tǒng)資源不足的情況 Youareusinglotsofstateandyoudonothavesufficientresourcestocacheallstatefortheentireapplication 資源的可靠性和性能良好 此時(shí)被動(dòng)裝載的又是更明顯 Youareusingreliableandresponsiveresources suchasadatabase network orWebservicethatwillnotimpedeapplicationstabilityandperformance 希望利用緩沖機(jī)制 但是在應(yīng)用程序的初始化時(shí) 希望不使用緩沖 而是根據(jù)用戶輸入等條件 進(jìn)行緩沖 Youareinterestedincachingdatathatisnotavailableduringtheinitializationofanapplication Forexample thisdatamightbeaffectedbyuserinputsuchascommonsearchqueriesoruser specificdatasuchasauser sprofile 最佳實(shí)踐 Cache被動(dòng)裝載 November2004 1 Removeitemwithspecifiedkey 從緩沖中移除 productsCache Remove Product101Key 2 Noerroroccursifkeyisnotfound因此通過(guò)這種方法 不能知道ITEM是否移除了如果對(duì)象實(shí)現(xiàn)了ICacheRefreshItemAction 可以有信息 November2004 刷新緩沖 為了更有效的利用資源 您需要刷新緩沖 Usetomanagestorage memoryandotherresourcesefficiently精確刷新 Explicitflushing使用代碼 Initiatedbyapplicationcode全部移除 Removesallitemsfromthecache自我清除 Scavenging使用應(yīng)用程序塊的功能 Initiatedbyapplicationblock基于優(yōu)先級(jí)和最后訪問(wèn)的時(shí)間 Baseduponpriorityandlastaccesstime控制移除的精確度 Configurationsettingscontrolsizeofcacheandnumberremoved productsCache Flush November2004 自我清除 1 自我清除的配置緩沖中的最大元素?cái)?shù)量 Maximumelementsincache一次移除的數(shù)量 Numberofitemsremovedwhenscavengingoccurs November2004 自我清除 2 為緩沖建立優(yōu)先級(jí) productsCache Add Key1 CacheItem1 CacheItemPriority High newProductCacheRefreshAction expireNotice 優(yōu)先級(jí)的值LowNormalHighNotRemovable自我清除的算法 不需要擴(kuò)展 View ApplicationShare Demonstration LiveMeetingView ApplicationShare UseLiveMeeting EditSlideProperties toedit November2004 再次重復(fù)幾個(gè)關(guān)鍵點(diǎn) 1 支持客戶化后端存儲(chǔ) Backingstoreprovider ImplementIBackingStore derivefromBaseBackingStore UseConfigurationConsoletoselectcustomprovider支持客戶化過(guò)期策略ExpirationpolicyImplementICacheItemExpirationSpecifyobjectoncalltoAddmethodofCacheManagerobject另外 Anythingandeverything youhavethesourcecode Pleasepostextensionsandsuggestionstothecommunity November2004 Security Crypto Configuration DataAccess Logging Caching Exceptions 再次重復(fù)幾個(gè)關(guān)鍵點(diǎn) 2 Legend Dependency Plug in ConfigTool Announcing EnterpriseLibrary1 0 DownloaditToday November2004 patterns practicesLive 2005 6 7EnterpriseLibraryLogging InstrumentationApplicationBlock2005 6 7EnterpriseLibraryExceptionHandlingApplicationBlock2005 6 7EnterpriseLibraryCryptographyApplicationBlock2005 6 7BuildyourownEnterpriseLibraryApplicationBlock EnterpriseLibraryCommunity

注意事項(xiàng)

本文(企業(yè)庫(kù)系列講座:緩存應(yīng)用程序塊.ppt)為本站會(huì)員(xt****7)主動(dòng)上傳,裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng)(點(diǎn)擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因?yàn)榫W(wǎng)速或其他原因下載失敗請(qǐng)重新下載,重復(fù)下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號(hào):ICP2024067431號(hào)-1 川公網(wǎng)安備51140202000466號(hào)


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng),我們立即給予刪除!