《软件体系结构》课件 03-调用-返回体系结构风格_第1页
《软件体系结构》课件 03-调用-返回体系结构风格_第2页
《软件体系结构》课件 03-调用-返回体系结构风格_第3页
《软件体系结构》课件 03-调用-返回体系结构风格_第4页
《软件体系结构》课件 03-调用-返回体系结构风格_第5页
已阅读5页,还剩22页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

软件体系结构—调用/返回风格软件体系结构课程组本节内容调用/返回风格1风格变种22课程总结3调用/返回风格主程序/子程序风格经典的编程范式:功能分解面向对象/抽象数据类型(ADT)信息(表示,方法方法)隐藏层次结构每一层只能与其直接相邻的邻居进行通信其他客户端/服务器……调用/返回风格主程序/子程序风格单线程控制,划分为若干处理步骤功能模块:把步骤集成至模块中抽象数据类型(ADT)操作和数据绑定在一起,隐藏实现和其他秘密面向对象方法(动态绑定),多态(子类),重用(继承)对象活动于不同的进程/线程(分布式对象)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)数据抽象/面向对象数据抽象/面向对象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

交互:通过过程调用或类似的协议Polymorphism:Choosethemethodatrun-time

多态:在运行时选择具体的操作Inheritance:Shareddefinitionsoffunctionality

继承:对共享的功能保持唯一的接口Reuseandmaintenance:Exploitencapsulationandlocalitytoincreaseproductivity

复用和维护:利用封装和聚合提高生产力面向对象方法的问题ManagingmanyobjectsVastseaofobjectsrequiresadditionalstructuring

对象的海洋需要额外的结构来容纳HierarchicaldesignsuggestedbyBoochandParnasManagingmanyinteractionsSingleinterfacecanbelimiting&unwieldy(hence,“friends”)

单一的接口能力有限并且笨拙(于是,”友元”)Somelanguages/systemspermitmultipleinterfaces(innerclass,interface,multipleinheritance)DistributedresponsibilityforbehaviorMakessystemhardtounderstandInteractiondiagramsnowusedindesignCapturingfamiliesofrelateddesignsTypes/classesareoftennotenoughDesignpatternsasanemergingoff-shoot如何管理大的对象数据集PureO-OdesignleadstolargeflatsystemswithmanyobjectsSameoldproblemscanreappearHundredsofmodules=>hardtofindthingsNeedawaytoimposestructureNeedadditionalstructureanddisciplineStructuringoptionsLayers(whicharenotnecessarilyobjects)SupplementalindexHierarchicaldecomposition:bigobjectsandlittleobjects体系结构风格变种Client-serverObjectsareprocesses

进程就是对象Asymmetric:clientknowsaboutservers,butnotviceversa

不对称:客户端知道服务器,反之则不然TieredElaborationonclient-server

C/S模式的扩展Aggregationintorun-timestrata

运行时层的结合Usuallysmallnumberoftiers

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

支持动态配置的专门协议层次风格案例-操作系统硬件OS应用应用应用平台层次案例-计算机网络层次风格Problem:Thispatternissuitableforapplicationsthatinvolvedistinctclassesofservicesthatcanbearrangedhierarchically.Oftentherearelayersforbasicsystem-levelservices,forutilitiesappropriatetomanyapplications,andforspecifictasksoftheapplication.Context:Frequently,eachclassofserviceisassignedtoalayerandseveraldifferentpatternsareusedtorefinethevariouslayers.Layersaremostoftenusedatthehigherlevelsofdesign,usingdifferentpatternstorefinethelayers.Solution:Systemmodel:hierarchyofopaquelayersComponents:usuallycomposites;compositesaremostoftencollectionsofproceduresConnectors:dependsonstructureofcomponents;oftenprocedurecallsunderrestrictedvisibility,mightalsobeclient/serverControlstructure:singlethread层次风格参考结构层次风格特点每层为上一层提供服务,使用下一层的服务,只能见到与自己邻接的层适当时候(必不得已的时候),可以允许一定的越层操作大的问题分解为若干个渐进的小问题,逐步解决,隐藏了很多复杂度修改一层,最多影响两层,而通常只能影响上层。接口稳固,则谁都不影响上层必须知道下层的身份,不能调整层次之间的顺序层层相调,影响性能

服务器客户客户客户客户客户LocalLoopback客户端/服务器风格两层C/S结构三层C/S结构B/S结构(浏览器/服务器风格)客户端/服务器风格两层客户端/服务器风格C/S软件体系结构是基于资源不对等,且为实现共享而提出的,20世纪90年代成熟起来C/S体系结构有三个主要组成部分:数据库服务器、客户应用程序和网络服务器(后台)负责数据管理,客户机(前台)完成与用户的交互任务。“胖客户机,瘦服务器”缺点:对客户端软硬件配置要求较高,客户端臃肿客户端程序设计复杂数据安全性不好。客户端程序可以直接访问数据库服务器。信息内容和形式单一用户界面风格不一,使用繁杂,不利用推广使用软件维护与升级困难。每个客户机上的软件都需要维护两层客户端/服务器风格与二层C

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论