您好,欢迎访问三七文档
软件工程第16章软件复用2019/11/15122019/11/15目标解释软件复用的好处和可能出现的一些问题讨论软件复用的途径和方法应用框架软件生产线开发讨论COTS复用32019/11/15内容复用概览应用框架软件产品线COTS产品的复用42019/11/15软件复用在大多数工程学科中的设计过程都是基于对现成系统或组件的复用的。软件工程起初主要关注原始开发,但现在为了获得更好的软件,更快的交付,以及更低的成本,需要在设计过程中采用系统的软件复用。过去10年,软件开发转向到基于复用的开发。52019/11/15基于复用的软件工程应用系统复用整个系统可以通过不加改变地融合到其他系统当中得以复用,也可以通过为不同的客户配置应用;组件复用应用系统的组件规模从子系统到单个对象都可以复用;对象和函数复用实现一个单一功能的软件组件,例如数学函数或者是一个对象类,可以重复使用。62019/11/15复用的好处IncreaseddependabilityReusedsoftware,thathasbeentriedandtestedinworkingsystems,shouldbemoredependablethannewsoftware.Theinitialuseofthesoftwarerevealsanydesignandimplementationfaults.Thesearethenfixed,thusreducingthenumberoffailureswhenthesoftwareisreused.ReducedprocessriskIfsoftwareexists,thereislessuncertaintyinthecostsofreusingthatsoftwarethaninthecostsofdevelopment.Thisisanimportantfactorforprojectmanagementasitreducesthemarginoferrorinprojectcostestimation.Thisisparticularlytruewhenrelativelylargesoftwarecomponentssuchassub-systemsarereused.EffectiveuseofspecialistsInsteadofapplicationspecialistsdoingthesameworkondifferentprojects,thesespecialistscandevelopreusablesoftwarethatencapsulatetheirknowledge.增加可靠性降低过程风险专家的有效使用72019/11/15复用的好处StandardscomplianceSomestandards,suchasuserinterfacestandards,canbeimplementedasasetofstandardreusablecomponents.Forexample,ifmenusinauserinterfacesareimplementedusingreusablecomponents,allapplicationspresentthesamemenuformatstousers.Theuseofstandarduserinterfacesimprovesdependabilityasusersarelesslikelytomakemistakeswhenpresentedwithafamiliarinterface.AccelerateddevelopmentBringingasystemtomarketasearlyaspossibleisoftenmoreimportantthanoveralldevelopmentcosts.Reusingsoftwarecanspeedupsystemproductionbecausebothdevelopmentandvalidationtimeshouldbereduced.标准一致加速开发82019/11/15复用的问题IncreasedmaintenancecostsIfthesourcecodeofareusedsoftwaresystemorcomponentisnotavailablethenmaintenancecostsmaybeincreasedasthereusedelementsofthesystemmaybecomeincreasinglyincompatiblewithsystemchanges.LackoftoolsupportCASEtoolsetsmaynotsupportdevelopmentwithreuse.Itmaybedifficultorimpossibletointegratethesetoolswithacomponentlibrarysystem.Thesoftwareprocessassumedbythesetoolsmaynottakereuseintoaccount.Not-invented-heresyndromeSomesoftwareengineerssometimesprefertore-writecomponentsastheybelievethattheycanimproveonthereusablecomponent.ThisispartlytodowithtrustandpartlytodowiththefactthatwritingoriginalsoftwareisseenasmorechallengingthanreusingotherpeopleÕssoftware.增加维护成本缺乏工具支持孤芳自赏92019/11/15复用的问题CreatingandmaintainingacomponentlibraryPopulatingareusablecomponentlibraryandensuringthesoftwaredeveloperscanusethislibrarycanbeexpensive.Ourcurrenttechniquesforclassifying,cataloguingandretrievingsoftwarecomponentsareimmature.Finding,understandingandadaptingreusablecomponentsSoftwarecomponentshavetobediscoveredinalibrary,understoodand,sometimes,adaptedtoworkinanewenvironment.Engineersmustbereasonablyconfidentoffindingacomponentinthelibrarybeforetheywillmakeroutinelyincludeacomponentsearchaspartoftheirnormaldevelopmentprocess.创建、维护和使用一个组件库查找、理解和改编可重用组件102019/11/1516.1复用概览尽管复用通常被简单地认为是系统组件的复用,但复用实际上包括很多不同的方法。复用范围包括从简单的函数复用到整个应用系统复用。复用概览涵盖了这些可能的复用技术。112019/11/15复用概览设计模式体系结构模式应用框架软件产品线COTS集成ERP系统可配置垂直应用遗留系统包装基于组件的开发模型驱动工程面向服务的系统面向方面的软件开发程序生成器程序库122019/11/15支持软件复用的方法DesignpatternsGenericabstractionsthatoccuracrossapplicationsarerepresentedasdesignpatternsthatshowabstractandconcreteobjectsandinteractions.Component-baseddevelopmentSystemsaredevelopedbyintegratingcomponents(collectionsofobjects)thatconformtocomponent-modelstandards.ThisiscoveredinChapter19.ApplicationframeworksCollectionsofabstractandconcreteclassesthatcanbeadaptedandextendedtocreateapplicationsystems.LegacysystemwrappingLegacysystems(seeChapter2)thatcanbeŌwrappedÕbydefiningasetofinterfacesandprovidingaccesstotheselegacysystemsthroughtheseinterfaces.Service-orientedsystemsSystemsaredevelopedbylinkingsharedservicesthatmaybeexternallyprovided.设计模式基于组件的开发应用框架遗留系统包装面向服务的系统132019/11/15支持软件复用的方法ApplicationproductlinesAnapplicationtypeisgeneralisedaroundacommonarchitecturesothatitcanbeadaptedindifferentwaysfordifferentcustomers.COTSintegrationSystemsaredevelopedbyintegratingexistingapplicationsystems.ConfigurableverticalapplicationsAgenericsystemisdesignedsothatitcanbeconfiguredtotheneedsofspecificsystemcustomers.ProgramlibrariesClassandfunctionlibrariesimplementingcommonly-usedabstractionsareavailableforreuse.ProgramgeneratorsAgeneratorsystemembedsknowledgeofaparticulartypesofapplicationandcangeneratesystemsorsystemfragmentsinthatdomain.Aspect-orientedsoftwaredevelopmentSharedcomponentsarewovenintoanapplicationatdifferentplaceswhentheprogramiscompiled.软件产品线COTS集成可配置垂直应用程序库程序生成器面向方面的软件开发142019/11/15规划复用需考虑到因素软件的开发进度规划所预计的软件生命期开发团队的背景、技术和经验软件的危险程度和它的非功能性需求应用领域系统运行平台152019/11/15概念复用当你复用程序或设计组件时,你不得不遵循组件原始开发者的设计决策。这可能会限制复用的可能。然而,有一种称为概念复用的更抽象的复用形式,即用一种与实现无关的方法描述复用(算法),并重新实现。有两种主要的概念复用方法:设计模式;基于生成器的复用Generativeprogramming.162019/11/1516.2应用框架框架是一组抽象及具体类与这些类之间的接口组成的子系统设计。子系统通过增加组件和实现框架中的抽象类等来实现。框架是合适的可复用的大粒度实体。172019/11/15框架类型
本文标题:16软件复用
链接地址:https://www.777doc.com/doc-1814305 .html