《軟件體系結構》課件 03-調用-返回體系結構風格_第1頁
《軟件體系結構》課件 03-調用-返回體系結構風格_第2頁
《軟件體系結構》課件 03-調用-返回體系結構風格_第3頁
《軟件體系結構》課件 03-調用-返回體系結構風格_第4頁
《軟件體系結構》課件 03-調用-返回體系結構風格_第5頁
已閱讀5頁,還剩22頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

軟件體系結構—調用/返回風格軟件體系結構課程組本節(jié)內容調用/返回風格1風格變種22課程總結3調用/返回風格主程序/子程序風格經(jīng)典的編程范式:功能分解面向對象/抽象數(shù)據(jù)類型(ADT)信息(表示,方法方法)隱藏層次結構每一層只能與其直接相鄰的鄰居進行通信其他客戶端/服務器……調用/返回風格主程序/子程序風格單線程控制,劃分為若干處理步驟功能模塊:把步驟集成至模塊中抽象數(shù)據(jù)類型(ADT)操作和數(shù)據(jù)綁定在一起,隱藏實現(xiàn)和其他秘密面向對象方法(動態(tài)綁定),多態(tài)(子類),重用(繼承)對象活動于不同的進程/線程(分布式對象)CS結構、分層風格組件多個接口,二進制兼容,高級中間件主程序/子程序風格主程序/子程序風格Problem:Thispatternissuitableforapplicationsinwhichthecomputationcanappropriatelybedefinedviaahierarchyofproceduredefinitions.Context:Manyprogramminglanguagesprovidenaturalsupportfordefiningnestedcollectionsofproceduresandforcallingthemhierarchically.Theselanguagesoftenallowcollectionsofprocedurestobegroupedintomodules,therebyintroducingname-spacelocality.Theexecutionenvironmentusuallyprovidesasinglethreadofcontrolinasinglenamespace.Solution:Systemmodel:callanddefinitionhierarchy,subsystemsoftendefinedviamodularityComponents:proceduresandexplicitlyvisibledataConnectors:procedurecallsandexplicitdatasharingControlstructure:singlethread模塊分解ParnasHidesecrets.OK,what’sa“secret”?RepresentationofdataPropertiesofadevice,otherthanrequiredpropertiesMechanismsthatsupportpoliciesTrytolocalizefuturechangeHidesystemdetailslikelytochangeindependentlyExposeininterfacesassumptionsunlikelytochangeUsefunctionstoallowforchangeThey’reeasiertochangethanvisiblerepresentation封裝/信息隱藏Parnas:Hidesecrets(notjustrepresentations)Booch:Object’sbehaviorischaracterizedbyactionsthat

itsuffersandthatitrequiresPracticallyspeaking:Objecthasstateandoperations,butalsohasresponsibilityfortheintegrityofitsstateObjectisknownbyitsinterfaceObjectisprobablyinstantiatedfromatemplateObjecthasoperationstoaccessandalterstateandperhapsgeneratorTherearedifferentkindsofobjects(e.g.,actor,agent,server)數(shù)據(jù)抽象/面向對象數(shù)據(jù)抽象/面向對象Problem:Thispatternissuitableforapplicationsinwhichacentralissueisidentifyingandprotectingrelatedbodiesofinformation,especiallyrepresentationinformation.Context:Numerousdesignmethodsprovidestrategiesforidentifyingnaturalobjects.Newerprogramminglanguagessupportvariousvariationsonthetheme,soifthelanguagechoiceorthemethodologyisfixed,thatwillstronglyinfluencetheflavorofthedecomposition.Solution:Systemmodel:localizedstatemaintenanceComponents:managers(e.g.,servers,objects,abstractdatatypes)Connectors:procedurecallControlstructure:decentralized,usuallysinglethread面向對象體系結構的元素Encapsulation:Restrictaccesstocertaininformation

封裝:限制對某些信息的訪問Interaction:Viaprocedurecallsorsimilarprotocol

交互:通過過程調用或類似的協(xié)議Polymorphism:Choosethemethodatrun-time

多態(tài):在運行時選擇具體的操作Inheritance:Shareddefinitionsoffunctionality

繼承:對共享的功能保持唯一的接口Reuseandmaintenance:Exploitencapsulationandlocalitytoincreaseproductivity

復用和維護:利用封裝和聚合提高生產(chǎn)力面向對象方法的問題ManagingmanyobjectsVastseaofobjectsrequiresadditionalstructuring

對象的海洋需要額外的結構來容納HierarchicaldesignsuggestedbyBoochandParnasManagingmanyinteractionsSingleinterfacecanbelimiting&unwieldy(hence,“friends”)

單一的接口能力有限并且笨拙(于是,”友元”)Somelanguages/systemspermitmultipleinterfaces(innerclass,interface,multipleinheritance)DistributedresponsibilityforbehaviorMakessystemhardtounderstandInteractiondiagramsnowusedindesignCapturingfamiliesofrelateddesignsTypes/classesareoftennotenoughDesignpatternsasanemergingoff-shoot如何管理大的對象數(shù)據(jù)集PureO-OdesignleadstolargeflatsystemswithmanyobjectsSameoldproblemscanreappearHundredsofmodules=>hardtofindthingsNeedawaytoimposestructureNeedadditionalstructureanddisciplineStructuringoptionsLayers(whicharenotnecessarilyobjects)SupplementalindexHierarchicaldecomposition:bigobjectsandlittleobjects體系結構風格變種Client-serverObjectsareprocesses

進程就是對象Asymmetric:clientknowsaboutservers,butnotviceversa

不對稱:客戶端知道服務器,反之則不然TieredElaborationonclient-server

C/S模式的擴展Aggregationintorun-timestrata

運行時層的結合Usuallysmallnumberoftiers

通常只有少量的層Components(later)MultipleinterfacesSpecialprotocolsfordynamicreconfiguration

支持動態(tài)配置的專門協(xié)議層次風格案例-操作系統(tǒng)硬件OS應用應用應用平臺層次案例-計算機網(wǎng)絡層次風格Problem:Thispatternissuitableforapplicationsthatinvolvedistinctclassesofservicesthatcanbearrangedhierarchically.Oftentherearelayersforbasicsystem-levelservices,forutilitiesappropriatetomanyapplications,andforspecifictasksoftheapplication.Context:Frequently,eachclassofserviceisassignedtoalayerandseveraldifferentpatternsareusedtorefinethevariouslayers.Layersaremostoftenusedatthehigherlevelsofdesign,usingdifferentpatternstorefinethelayers.Solution:Systemmodel:hierarchyofopaquelayersComponents:usuallycomposites;compositesaremostoftencollectionsofproceduresConnectors:dependsonstructureofcomponents;oftenprocedurecallsunderrestrictedvisibility,mightalsobeclient/serverControlstructure:singlethread層次風格參考結構層次風格特點每層為上一層提供服務,使用下一層的服務,只能見到與自己鄰接的層適當時候(必不得已的時候),可以允許一定的越層操作大的問題分解為若干個漸進的小問題,逐步解決,隱藏了很多復雜度修改一層,最多影響兩層,而通常只能影響上層。接口穩(wěn)固,則誰都不影響上層必須知道下層的身份,不能調整層次之間的順序層層相調,影響性能

服務器客戶客戶客戶客戶客戶LocalLoopback客戶端/服務器風格兩層C/S結構三層C/S結構B/S結構(瀏覽器/服務器風格)客戶端/服務器風格兩層客戶端/服務器風格C/S軟件體系結構是基于資源不對等,且為實現(xiàn)共享而提出的,20世紀90年代成熟起來C/S體系結構有三個主要組成部分:數(shù)據(jù)庫服務器、客戶應用程序和網(wǎng)絡服務器(后臺)負責數(shù)據(jù)管理,客戶機(前臺)完成與用戶的交互任務?!芭挚蛻魴C,瘦服務器”缺點:對客戶端軟硬件配置要求較高,客戶端臃腫客戶端程序設計復雜數(shù)據(jù)安全性不好??蛻舳顺绦蚩梢灾苯釉L問數(shù)據(jù)庫服務器。信息內容和形式單一用戶界面風格不一,使用繁雜,不利用推廣使用軟件維護與升級困難。每個客戶機上的軟件都需要維護兩層客戶端/服務器風格與二層C

溫馨提示

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

評論

0/150

提交評論