軟件體系結(jié)構(gòu)復(fù)習(xí)內(nèi)容.doc_第1頁(yè)
軟件體系結(jié)構(gòu)復(fù)習(xí)內(nèi)容.doc_第2頁(yè)
軟件體系結(jié)構(gòu)復(fù)習(xí)內(nèi)容.doc_第3頁(yè)
軟件體系結(jié)構(gòu)復(fù)習(xí)內(nèi)容.doc_第4頁(yè)
軟件體系結(jié)構(gòu)復(fù)習(xí)內(nèi)容.doc_第5頁(yè)
已閱讀5頁(yè),還剩15頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

軟件體系結(jié)構(gòu) 第 5 講: 體系結(jié)構(gòu)風(fēng)格(一)內(nèi)容簡(jiǎn)介:l 概述l 管道/過(guò)濾器風(fēng)格l 倉(cāng)庫(kù)風(fēng)格和黑板風(fēng)格l 分層系統(tǒng)風(fēng)格l 客戶服務(wù)器風(fēng)格l 軟件體系結(jié)構(gòu)風(fēng)格(模式)定義: 一些特定的元素按照特定方式組成的結(jié)構(gòu), 它有利于解決上下文環(huán)境里的特定問(wèn)題。描述了一族系統(tǒng),他們擁有一個(gè)類似的結(jié)構(gòu)定義了構(gòu)件(如客戶端、服務(wù)器)的字典刻畫了構(gòu)件的主要任務(wù)和交互方式l 軟件體系結(jié)構(gòu)風(fēng)格與設(shè)計(jì)模式等的區(qū)別程序設(shè)計(jì)樣式設(shè)計(jì)模式體系結(jié)構(gòu)風(fēng)格重點(diǎn)開發(fā)原則、可實(shí)現(xiàn)性重用、概念完整性重用、概念完整性抽象層次程序構(gòu)件體系結(jié)構(gòu)使用直接可用直接可用有約束和指導(dǎo)作用l 體系結(jié)構(gòu)風(fēng)格作用促進(jìn)設(shè)計(jì)重用 帶來(lái)代碼重用 使系統(tǒng)易于理解 有利于系統(tǒng)的互操作性l 體系結(jié)構(gòu)風(fēng)格分類 固定術(shù)語(yǔ)類l 管道和過(guò)濾器的風(fēng)格l 倉(cāng)庫(kù)風(fēng)格和黑板風(fēng)格l 分層系統(tǒng)風(fēng)格l 客戶服務(wù)器風(fēng)格l 數(shù)據(jù)抽象和面向?qū)ο箫L(fēng)格l 基于事件的風(fēng)格l 模型-視圖-控制器風(fēng)格l 解釋器風(fēng)格(虛擬機(jī)風(fēng)格) 參考模型類l 編譯器的順序參考模型和并行參考模型l 信息系統(tǒng)的參考模型管道/過(guò)濾器風(fēng)格l 構(gòu)件: 過(guò)濾器(對(duì)數(shù)據(jù)進(jìn)行處理)l 連接件: 管道(傳輸數(shù)據(jù))過(guò)濾器過(guò)濾器過(guò)濾器過(guò)濾器過(guò)濾器過(guò)濾器圖5-1 管道和過(guò)濾器風(fēng)格體系結(jié)構(gòu)管道管道管道管道管道管道管道l 應(yīng)用: Unix 的Shell程序 cat file |grep xyz |sort |uniq out 編譯器 信號(hào)處理l 編譯器從邏輯上可以分成若干階段,每個(gè)階段把源程序從一種表示變換成另一種表示l 優(yōu)點(diǎn): 允許構(gòu)造松散結(jié)構(gòu)的系統(tǒng) 過(guò)濾器的重用很方便 易于擴(kuò)展和修改l 缺點(diǎn): 導(dǎo)致批處理風(fēng)格的系統(tǒng)設(shè)計(jì) 交互性不強(qiáng) 同步比較困難 應(yīng)用范圍比較狹隘倉(cāng)庫(kù)風(fēng)格和黑板風(fēng)格l 構(gòu)件: 中央數(shù)據(jù)結(jié)構(gòu)(當(dāng)前狀態(tài)) 獨(dú)立構(gòu)件(對(duì)數(shù)據(jù)進(jìn)行處理)l 運(yùn)作方式: 主動(dòng)式:構(gòu)件自己決定操作 被動(dòng)式:由數(shù)據(jù)倉(cāng)庫(kù)的當(dāng)前狀態(tài)來(lái)決定調(diào)用構(gòu)件(黑板系統(tǒng))l 黑板系統(tǒng)三大部分 知識(shí)源 黑板數(shù)據(jù)結(jié)構(gòu) 控制器知識(shí)源知識(shí)源知識(shí)源知識(shí)源知識(shí)源黑板共享數(shù)據(jù)知識(shí)源知識(shí)源知識(shí)源知識(shí)源存儲(chǔ)器計(jì)算直接存取圖5-2 黑板風(fēng)格的體系結(jié)構(gòu)l 應(yīng)用: 語(yǔ)音識(shí)別 模式識(shí)別 三維分子結(jié)構(gòu)建模l 優(yōu)點(diǎn):便于多客戶共享大量數(shù)據(jù),它們不用關(guān)心數(shù)據(jù)何時(shí)有的、誰(shuí)提供的、怎樣提供的; 既便于添加新的作為知識(shí)源代理的應(yīng)用程序,也便于擴(kuò)展共享的黑板數(shù)據(jù)結(jié)構(gòu)。l 缺點(diǎn):不同的知識(shí)源代理對(duì)于共享數(shù)據(jù)結(jié)構(gòu)要達(dá)成一致,而且,這也造成對(duì)黑板數(shù)據(jù)結(jié)構(gòu)的修改較為困難要考慮到各個(gè)代理的調(diào)用; 需要一定的同步/加鎖機(jī)制保證數(shù)據(jù)結(jié)構(gòu)的完整性和一致性,增大了系統(tǒng)復(fù)雜度。分層系統(tǒng)風(fēng)格l 一個(gè)分層風(fēng)格的系統(tǒng)按照層次結(jié)構(gòu)組織,每一層向它的上層提供服務(wù)。內(nèi)核層用戶基本功能可用系統(tǒng)過(guò)程調(diào)用不同元素組合圖5-3 分層系統(tǒng)的體系結(jié)構(gòu)圖10-5Windows 2000的網(wǎng)絡(luò)體系結(jié)構(gòu)圖10-7 Windows 2000網(wǎng)絡(luò)體系結(jié)構(gòu)中的TCP/IPl 應(yīng)用:OSI-ISO七層模型 操作系統(tǒng) 數(shù)據(jù)庫(kù)系統(tǒng) TCP/IP網(wǎng)絡(luò)協(xié)議l 優(yōu)點(diǎn):由于對(duì)層次的鄰接層數(shù)目進(jìn)行了限制,所以系統(tǒng)易于改進(jìn)和擴(kuò)展; 每一層的軟件都易于重用,并可為某一層次提供多種可互換的具體實(shí)現(xiàn); 分層系統(tǒng)所支持的設(shè)計(jì)體現(xiàn)了不斷增加的抽象層次,這樣,一個(gè)復(fù)雜問(wèn)題的求解被分解為一系列遞增的步驟。l 缺點(diǎn):系統(tǒng)的分層可能會(huì)帶來(lái)效率方面的問(wèn)題; 應(yīng)當(dāng)如何界定層次間的劃分是一個(gè)較為復(fù)雜的問(wèn)題。l 構(gòu)件:客戶構(gòu)件 服務(wù)器構(gòu)件l 連接件:進(jìn)程間通信機(jī)制l 兩種特殊的客戶服務(wù)器風(fēng)格 代理l 服務(wù)器的服務(wù)交給一個(gè)代理,由代理來(lái)向客戶提供服務(wù)l 代表性應(yīng)用:CORBA SOAP WebService UDDI P2Pl 客戶服務(wù)器對(duì)稱,既是客戶又是服務(wù)器l 代表性應(yīng)用: BT, Emule, Kazza 應(yīng)用: 大量的信息管理系統(tǒng) 優(yōu)點(diǎn):有利于分布式的數(shù)據(jù)組織; 構(gòu)件間是位置透明的,客戶和服務(wù)器都不用考慮對(duì)方的運(yùn)行位置; 便于異質(zhì)平臺(tái)間的融合與匹配,客戶和服務(wù)器可以運(yùn)行不同操作系統(tǒng); 具有良好的可擴(kuò)展性,易于對(duì)服務(wù)器進(jìn)行修改、擴(kuò)展或增加服務(wù)器; 缺點(diǎn):客戶必須知道服務(wù)器的訪問(wèn)標(biāo)識(shí),否則很難知道有哪些可用服務(wù)。 l 分層系統(tǒng)風(fēng)格實(shí)例l 數(shù)據(jù)抽象和面向?qū)ο箫L(fēng)格l 基于事件的風(fēng)格l 模型-視圖-控制器風(fēng)格l 解釋器風(fēng)格(虛擬機(jī)風(fēng)格)l 信息系統(tǒng)的參考模型l 體系結(jié)構(gòu)風(fēng)格的選擇分層系統(tǒng)風(fēng)格實(shí)例l 系統(tǒng)描述:勞動(dòng)和社會(huì)保險(xiǎn)管理信息系統(tǒng) 系統(tǒng)的功能是完成勞動(dòng)和社會(huì)保險(xiǎn)的主要業(yè)務(wù)管理,即“五保合一”管理,包括養(yǎng)老保險(xiǎn)、醫(yī)療保險(xiǎn)、勞動(dòng)就業(yè)和失業(yè)保險(xiǎn)、工傷保險(xiǎn)、女工生育保險(xiǎn)。整個(gè)業(yè)務(wù)流程十分復(fù)雜,牽涉面相當(dāng)廣泛。例如,整個(gè)系統(tǒng)要與銀行、企業(yè)、事業(yè)機(jī)關(guān)、醫(yī)院、財(cái)政部門、稅務(wù)部門、郵局等多種單位建立連接關(guān)系。 核心層 通用打印基類 通用查詢基類 權(quán)限驗(yàn)證基類 通用數(shù)據(jù)庫(kù)連接基類 字符處理基類 碼表維護(hù)基類 數(shù)據(jù)轉(zhuǎn)換基類 基層單位管理平臺(tái) 業(yè)務(wù)管理系統(tǒng) 擴(kuò)展應(yīng)用層數(shù)據(jù)抽象和面向?qū)ο箫L(fēng)格l 構(gòu)件: 數(shù)據(jù)和操作的復(fù)合體對(duì)象l 連接件: 函數(shù)或過(guò)程調(diào)用l 應(yīng)用: COM, CORBA等l 優(yōu)點(diǎn): 隱藏實(shí)現(xiàn)細(xì)節(jié) 繼承性,有利于重用l 缺點(diǎn): 過(guò)程調(diào)用依賴于對(duì)象標(biāo)識(shí)的確定 不同對(duì)象的操作關(guān)聯(lián)性差基于事件的風(fēng)格(隱式調(diào)用)l 構(gòu)件: 模塊l 連接件: 對(duì)事件的顯式/隱式調(diào)用agentagentagentagent廣播媒介圖5-6 基于事件的體系結(jié)構(gòu)風(fēng)格聲明事件監(jiān)聽事件監(jiān)聽事件聲明事件l 應(yīng)用: 各種基于事件響應(yīng)的Windows程序l 優(yōu)點(diǎn): 事件廣播者不必知道哪些部件會(huì)被事件影響 有利于軟件復(fù)用,任何構(gòu)件均可以注冊(cè)其相關(guān)事件 系統(tǒng)演化、升級(jí)比較簡(jiǎn)單l 缺點(diǎn): 構(gòu)件的調(diào)用不是主動(dòng)的 系統(tǒng)正確性難以推理模型-視圖-控制器風(fēng)格 3種構(gòu)件l 視圖:負(fù)責(zé)顯示信息l 模型:負(fù)責(zé)維護(hù)數(shù)據(jù),是應(yīng)用程序的核心l 控制器:負(fù)責(zé)與用戶的交互用戶視圖控制器模型問(wèn)題領(lǐng)域的應(yīng)用程序查看使用操作更新圖5-7 模型視圖控制器風(fēng)格的體系結(jié)構(gòu)l 應(yīng)用: Visual Studio提供的文檔視圖結(jié)構(gòu) 各種可以更換皮膚的軟件l 文檔 數(shù)據(jù)容器l 視圖: 查看數(shù)據(jù)的窗口或是和數(shù)據(jù)發(fā)生交互的窗口。 l 文檔/視圖的核心是四個(gè)關(guān)鍵類: CDocument(或 COleDocument)類支持用于存儲(chǔ)或控制程序數(shù)據(jù)的對(duì)象,并為程序員定義的文檔類提供基本功能。文檔表示數(shù)據(jù)單元,用戶一般用“文件”菜單上的“打開”命令打開它,并用“文件”菜單上的“保存”命令保存它。 CView(或它的許多派生類之一)為程序員定義的視圖類提供基本功能。視圖被附加到文檔并在文檔和用戶之間充當(dāng)中介:視圖在屏幕上呈現(xiàn)文檔的圖像并將用戶輸入解釋為對(duì)文檔的操作。視圖還為打印和打印預(yù)覽呈現(xiàn)圖像。 CFrameWnd(或其變體之一)支持在文檔的一個(gè)或多個(gè)視圖周圍提供框架的對(duì)象。 CDocTemplate(或 CSingleDocTemplate 或 CMultiDocTemplate)支持一個(gè)對(duì)象,該對(duì)象協(xié)調(diào)給定類型的一個(gè)或多個(gè)現(xiàn)有文檔并對(duì)創(chuàng)建該類型的正確文檔、視圖和框架窗口對(duì)象進(jìn)行管理。l 文檔視結(jié)構(gòu)帶來(lái)的好處主要有: 首 先是將數(shù)據(jù)操作和數(shù)據(jù)顯示、用戶界面分離開。這是一種“分而治之”的思想,這種思想使得模塊劃分更加合理、模塊獨(dú)立性更強(qiáng),同時(shí)也簡(jiǎn)化了數(shù)據(jù)操作和數(shù)據(jù)顯 示、用戶界面工作。 MFC在文檔/視結(jié)構(gòu)上提供了許多標(biāo)準(zhǔn)操作界面,包括新建文件、打開文件、保存文件、打印等,減輕了用戶的工作量。 支持打印預(yù)覽和電子郵件發(fā)送功能。l 以下情況不宜采用文檔視結(jié)構(gòu): 不是面向數(shù)據(jù)的應(yīng)用或數(shù)據(jù)量很少的應(yīng)用程序,不宜采用文檔/視結(jié)構(gòu)。如一些工具程序包括磁盤掃描程序、時(shí)鐘程序,還有一些過(guò)程控制程序等。 不使用標(biāo)準(zhǔn)的窗口用戶界面的程序,象一些游戲等。l 優(yōu)點(diǎn): 簡(jiǎn)化系統(tǒng)設(shè)計(jì), 界面友好l 缺點(diǎn): 適用范圍比較狹隘,局限在用戶界面軟件開發(fā)領(lǐng)域解釋器風(fēng)格(虛擬機(jī)風(fēng)格)l 構(gòu)件; 被解釋程序 執(zhí)行引擎 執(zhí)行引擎的當(dāng)前狀態(tài) 被解釋程序的當(dāng)前狀態(tài)l 連接件: 過(guò)程調(diào)用 存儲(chǔ)器訪問(wèn)l 應(yīng)用: 各種虛擬機(jī),如Java虛擬機(jī) 各種腳本語(yǔ)言的解釋器,如Perl等l 優(yōu)點(diǎn): 應(yīng)用程序的可移植性和程序設(shè)計(jì)語(yǔ)言的跨平臺(tái)能力 對(duì)硬件進(jìn)行仿真l 缺點(diǎn): 效率比較低信息系統(tǒng)的參考模型圖5-16 ISO的OSI參考模型體系結(jié)構(gòu)風(fēng)格的選擇問(wèn)題描述:l 倉(cāng)庫(kù)風(fēng)格 優(yōu)點(diǎn):l 數(shù)據(jù)共享適合采用高效的表達(dá)方式l 計(jì)算分布于獨(dú)立模塊,符合呈現(xiàn)問(wèn)題的自覺(jué)思維習(xí)慣 缺點(diǎn):l 不易修改,共享數(shù)據(jù)表示將影響到所有模塊l 數(shù)據(jù)抽象風(fēng)格 優(yōu)點(diǎn):l 易于修改,數(shù)據(jù)表示和算法可以在單獨(dú)模塊修改而不會(huì)對(duì)模塊間產(chǎn)生相互影響l 更好地支持重用 缺點(diǎn):l 不易更改系統(tǒng)功能,除非打破模塊界限或增加新的模塊l 修改現(xiàn)存模塊將導(dǎo)致模塊簡(jiǎn)潔性和完整性受到破壞l 管道過(guò)濾器風(fēng)格 優(yōu)點(diǎn):l 維護(hù)了一種直覺(jué)的處理流程l 更好地支持重用,容易加入新功能 缺點(diǎn):l 很難支持與用戶的交互l 空間使用效率低,每個(gè)過(guò)濾器必須拷貝全部數(shù)據(jù)到它的輸入口Lecture 7. Domain Specific SA Style-P2P architecture1. Problems with traditional C-S architecture2. Introduction to P2P3. Basic Knowledge of Peer-to-Peer Architecture4. Hybrid P2P architecture5. Pure P2P Architecture6. Pure Peer-to-Peer architecture: Gnutella7. Peer node Architecture, 每個(gè)節(jié)點(diǎn)的結(jié)構(gòu)8. Data Transfer Mechanism from Node to Node9. Some Issues of Further P2P Evolution . Problems with traditional C-S architectureProblem 1: 很難在海量信息中找到有價(jià)值的東西. First, no single search engine can locate and catalog the ever-increasing amount of information on the Web in a timely way Google claims that it searches about 1.3x108 web pages Finding useful information in real time is increasingly difficultProblem 2: 互聯(lián)網(wǎng)的應(yīng)用不平衡. Second, although miles of new fiber have been installed, the new bandwidth gets little use if everyone goes to Yahoo and eBay for content Hot spots just get hotter while cold spots remain cold Internet has not been utilized efficiently Resources have not been used efficientlyProblem 3: 服務(wù)器的壓力. Pressure: As the number of users increases, there is a higher demand for computing power, storage space, and bandwidth associated with the server-side Problem 4:可靠性是個(gè)問(wèn)題 Reliability (可靠性) The whole network will depend on the highly loaded server to function properly If a server is down, then the client may suffer heavy losesP2PC/S1. P2P enables any network-aware device to provide services to another network-aware device2. A peer in P2P network acts as both a client and a server. Basic Knowledge of Peer-to-Peer ArchitecturePeer-to-Peer: the Third Generation of the Internet!What is Peer-to-Peer (P2P)? Peer-to-Peer computing is described as the sharing of computer resources and services by direct exchange between systems. 共享計(jì)算機(jī)資源 These resources include a) the exchange of information, 信息交換b) processing cycles, 處理能力 (過(guò)程,周期)c) cache storage, and 高速緩沖存儲(chǔ)器存儲(chǔ)d) disk storage for files. 硬盤存儲(chǔ)Advantage of P2P-P2P 結(jié)構(gòu)的優(yōu)點(diǎn)a) It allows economical clients (desktop computers, etc) to take advantage of their collective power to benefit the entire enterprise (發(fā)揮集體優(yōu)勢(shì))b) Clients in a P2P network are also servers (大家都是客戶端,大家都是服務(wù)器)c) The load on servers in the traditional sense has reduced (服務(wù)器壓力減輕了4. hybrid P2P architecture (雜交的P2P結(jié)構(gòu)) 客戶互動(dòng)機(jī)制. The interaction between clients by referencing a Directory Server n Client A issues a request to the Directory server 客戶A發(fā)一個(gè)請(qǐng)求給目錄服務(wù)器n The Directory server then uses the lists it keep to find the peer that contains the content that Client A interests in and tells Client A 目錄服務(wù)器找到客戶A感興趣的服務(wù)器n Client A can then directly interact with that client, in this case Client D which services his request. 客戶A 和那個(gè)客戶直接互動(dòng). Detailed description of How one peer interacts with another peer Step 1. When the user connects to the network, the peer first attempts to connect to a directory server (首先連接到目錄服務(wù)器) to locate each of the users buddies and 尋找朋友 to register the location of the user that is now coming on-line 登記在線的用戶的地址 Note: If a directory service is not available or if information is not available for a particular buddy, the peer first falls back on cached knowledge about the locations of buddies (如果找不到目錄服務(wù)器或者朋友信息,到緩存去找) by deriving from previous contact with a directory service, previous contact with those buddies, or information entered by the user. Cache: 高速緩沖存儲(chǔ)器n Step 1 (cont) Once peers are located, they can provide information about their capabilities and the services they provide. (找到了朋友,就知道了他們的信息) Step 2. Opening the lines of communication (開通通訊線路) After it determines their locations, the peer then attempts to establish contact with all of the buddies that it has found. The peer can use a user interface for contacts The user interface provides information to the user about what other users are on-line. Pure P2P ArchitectureCharacteristics of Pure P2P Architecturea) Peers can act as clients and servers and have the same capability as its neighbors.b) It has no central servers. It has every node as a Peer and has no central router.c) There are two routing structures, one is a distributed catalogue (分布式目錄) and the other direct messaging. 兩臺(tái)計(jì)算機(jī)建立聯(lián)系的過(guò)程: 1. Send message to all peers: who has “200 Days on the Moon” 2. Got answer: I have 3. Build direct connection 什么是純的P2P模型? Gnutella, a Pure P2P Model is a file sharing application and protocol: the end hosts join Gnutella by connecting to existing end hosts already on the Gnutella. How Gnutella works? 用互相傳送消息的方法,實(shí)現(xiàn)文件共享 To facilitate file sharing, messages are sent between end hosts. How Gnutella works? 怎樣查詢廣播和回答? 廣播要查詢的文件 Queries for files are broadcasted on the overlay network, and 回答被發(fā)送到初始的發(fā)廣播的那個(gè)peer Replies are routed back to the host that originally generated the query through the overlay network. 工作步驟-Steps:1. Node A is first connected to the network.2. It Pings to the other Nodes (B and C) to discover new nodes on the network.3. A pong message is sent as a reply to a ping and provides information on a network node, including IP address, port number, and number of files shared.4. A query message is used to search for files shared by other nodes on the network. It contains a query string and a minimum requested link speed.5. A query reply message contains a list of one or more files which match a given query, the size of each file, and the link speed of the responding node.6. A push message is used to upload file to clients behind a firewall who can not download files themselves.Note: For the connection, a node has to know the IP of the other node that is already online.a) once it is connected, it makes an announcement that it is online. b) Each of the other nodes reply to the message of information like the number of files it contains and the other details. b) For the file sharing to happen, the node acts as a HTTP Web Server.c) If the search has to download, it connects to the node in the same way as a browser would connect to a web server. How long will a specific request live“? 存活時(shí)間. TTL: time to live. It determines how long a specific request will live on the network. The number is actually how many layers each request will pass through, where a layer is when one servant has sent the request to all of the servants connected to it. Gnutella Protocol Gnutella is a distributed protocol, since there are no Gnutella servers in the traditional sense, like web servers or mail servers. Gnutella Protocol (cont) Gnutellas protocol is such that the clients become servers and they become clients at the same time. A node is a Client when it is looking for some data and is a Sever if it is servicing a request of another node. The communication between the nodes is done by the TCP/IP protocol.Properties of Gnutellaa) If one computer goes down the network is unaffected, Hence more reliable.b) Gnutella permits swapping files of any type. c) Gnutella is anonymous-there is no need to provide a name or e-mail address to use Gnutella, since.匿名的. d) Gnutella provides a mechanism of resource sharing: People can share their family photos, masters thesis, computer program, and home movies - anything they want! 資源共享e) Gnutella is Pure P2P and is completely decentralized.f) 開發(fā)組織Developing OrganizationGnutella has become much popular recently so there are not a single organization that is very popular, rather there are many who are upcoming. a) LimeWire, b) BearShare, c) Morpheus d) Etc. 7. Peer Node Architecture 每個(gè)節(jié)點(diǎn)的結(jié)構(gòu)Peer-to-Peer Network Architecture P2P is a type of network in which each workstation has equivalent capabilities and responsibilities. Using the HTTP protocol, peers link together in networks to share information and services.Functionalities of a Peer Each peer provides a basic set of core services: handles communication with the network, manages information about the location, status, and privileges. provides the foundation for extension modules The architecture of a Peer The architecture of a Peer implements the layered architectural Pattern. The functions are layered one on top of the other. 1. web server 2. Servlet engine3. The request manager 4. The event service 5. Buddy manager6. Access control2. 網(wǎng)絡(luò)服務(wù)器基礎(chǔ)層的功能. The system is based on top of a Web server and servlet engine that trigger functionality based on incoming HTTP requests. 1. The network infrastructure may vary by platform and provides the binding to the Web services available on that platform. 2. It provides simple parsing of the HTTP requests, passing the content on to the platform independent request manager.Request Manager receives the HTTP request from the server and, depending on the content, invokes services within the peer to handle the request. 模塊注冊(cè)請(qǐng)求并提供服務(wù). Loaded modules may register for requests based on the URL. When the request manager passes a request to a module, it can provide the response (if any) to be returned, or pass the request along to another module for additional processing. Event Service (事件服務(wù)). Receive events that are passed over HTTP. The events carry the bulk (大多數(shù)) of communication between peers. Functionalities of Event service (事件服務(wù)的功能) receive the events (接收事件) invoke the services that have registered interest in those events (調(diào)用對(duì)到來(lái)事件感性趣的服務(wù)) allow components to send events to other peers本機(jī)可以通過(guò)事件服務(wù)發(fā)送事件給其他的peer. 每個(gè)事件中包含的內(nèi)容 Within each event is information about its creation: the address of the creator, a local timestamp, and a globally unique identifier string. Buddy Manager (朋友管理器) Functionalities Buddy Manager is a means of identifying individual users and (確認(rèn)用戶) controlling the access relationships between peers: who may access resources and about whom the user would like information (控制訪問(wèn)關(guān)系)Access Controller (訪問(wèn)控制) 利用到來(lái)事件信息決定那些用戶是否受歡迎 Information in the incoming event or HTTP request serves to identify users as being welcome or not It also defined levels of access, thus the user may permit or deny access to services. Module Container (模塊箱) Dynamically loaded extension modules that provide new functionality for specific applications extend the peers core functionality. Allow custom configuration of peers, in most cases even while the peer is running. (定制配制) May be mapped to handle incoming HTTP requests, register for events, send events to other peers, etc. (處理請(qǐng)求) Can communicate in a controlled fashion with other modules within the same peer (和其他模塊交流)8. Data Transfer Mechanism from Node to Node P2P 用管道-過(guò)濾器結(jié)構(gòu)交流The Peer-to-Peer system uses Pipes and Filters to effectively transfer data from one system to another. Functionalities of a filter When a peer requests for a file, a filter component effectively filters the unwanted files which do not match the search criteria and produces a result in the form of a list to the query. (過(guò)濾掉不需要的文件) Functionalities of a pipe Then when the user chooses to do

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論