软件工程-实践者的研究方法(7)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1Chapter8DesignConceptsSoftwareEngineering:APractitioner’sApproach,7/ebyRogerS.Pressman2DesignGoodsoftwaredesignshouldexhibit:Firmness(稳定性):Aprogramshouldnothaveanybugsthatinhibititsfunction.Commodity(适用性):Aprogramshouldbesuitableforthepurposesforwhichitwasintended.Delight(令人愉快):Theexperienceofusingtheprogramshouldbepleasurableone.3AnalysisModel=DesignModelAnalysisModeluse-cases-textuse-casediagramsactivitydiagramsswimlanediagramsdataflowdiagramscontrol-flowdiagramsprocessingnarrativesflow-orientedelementsbehavioralelementsclass-basedelementsscenario-basedelementsclassdiagramsanalysispackagesCRCmodelscollaborationdiagramsstatediagramssequencediagramsData/ClassDesignArchitecturalDesignInterfaceDesignComponent-LevelDesignDesignModel43CharactersofDesignQualitythedesignmustimplementalloftheexplicit(明确的)requirementscontainedintheanalysismodel,anditmustaccommodatealloftheimplicit(隐含的)requirementsdesiredbythecustomer.thedesignmustbeareadable,understandableguideforthosewhogeneratecodeandforthosewhotestandsubsequentlysupportthesoftware.thedesignshouldprovideacompletepicture(全貌)ofthesoftware,addressingthedata,functional,andbehavioraldomainsfromanimplementationperspective.5QualityGuidelinesAdesignshouldexhibitanarchitecturethat(1)hasbeencreatedusingrecognizablearchitecturalstylesorpatterns,(2)iscomposedofcomponentsthatexhibitgooddesigncharacteristicsand(3)canbeimplementedinanevolutionaryfashionAdesignshouldbemodular;thatis,thesoftwareshouldbelogicallypartitionedintoelementsorsubsystemsAdesignshouldcontainrepresentationsofdata,architecture,interfaces,andcomponents.Adesignshouldleadtodatastructuresthatareappropriatefortheclassestobeimplemented.Adesignshouldleadtocomponentsthatexhibitindependentfunctionalcharacteristics.Adesignshouldleadtointerfacesthatreducethecomplexityofconnectionsbetweencomponentsandwiththeexternalenvironment.Adesignshouldbederivedusingarepeatablemethodthatisdrivenbyinformationobtainedduringsoftwarerequirementsanalysis.Adesignshouldberepresentedusinganotationthateffectivelycommunicatesitsmeaning.6DesignPrinciplesThedesignshouldbetraceabletotheanalysismodel.Thedesignshouldnotreinvent(彻底改造)thewheel.Thedesignshould“minimizethedistance”betweenthesoftwareandtheproblemasitexistsintherealworld.Thedesignshouldexhibituniformityandintegration.Thedesignshouldbestructuredtoaccommodatechange.Thedesignshouldbeassessedforqualityasitisbeingcreated,notafterthefact.Thedesignshouldbereviewedtominimizeconceptual(semantic)errors.Designisnotcoding,codingisnotdesign.FromDavis[DAV95]7FundamentalConceptsAbstraction—data,procedureArchitecture(架构)—theoverallstructureofthesoftwarePatterns—conveys(承载)theessence(精髓)ofaprovendesignsolutionModularity—compartmentalization(划分)ofdataandfunctionInformationhiding—controlledinterfacesFunctionalindependence—single-mindedfunctionandlowcouplingAspects—amechanismforunderstandinghowglobalrequirementsaffectdesignRefactoring(重构)—areorganizationtechniquethatsimplifiesthedesignDesignClasses—providedesigndetailthatwillenableanalysisclassestobeimplemented8DataAbstractiondoorimplementedasadatastructuremanufacturermodelnumbertypeswingdirectioninsertslightsweightopeningmechanism9ProceduralAbstractionopenimplementedwithaknowledgeoftheobjectthatisassociatedwithenterdetailsofenteralgorithm10Architecture“Theoverallstructureofthesoftwareandthewaysinwhichthatstructureprovidesconceptualintegrityforasystem.”Structuralproperties.Thisaspectofthearchitecturaldesignrepresentationdefinesthecomponentsofasystem(e.g.,modules,objects)andthemannerinwhichthosecomponentsarepackagedandinteractwithoneanother.Forexample,objectsencapsulatebothdataandtheprocessingthatmanipulatesthedata.Extra-functionalproperties.Thearchitecturaldesigndescriptionshouldaddresshowthedesignarchitectureachievesrequirementsforperformance,capacity,reliability,security,adaptability,andothersystemcharacteristics.Families(族)ofrelatedsystems.Thearchitecturaldesignshoulddrawuponrepeatablepatternsthatarecommonlyencounteredinthedesignoffamiliesofsimilarsystems.Thedesignshouldhavetheabilitytoreusearchitecturalbuildingblocks.11ArchitectureInthesimplestform,architectureisthestructureororganizationofprogramcomponents(modules),themannerinwhichthesecomponentsinteract,andthestructureofdatathatareusedbythecomponents.Inabroadersense,componentscanbegeneralizedtorepresentmajorsystemelementsandtheirinteractions.本地子系统远端子系统图像采集机器人控制系统图像压缩图像发送图像处理任务处理命令接收机器人控制图像处理任务处理图像接收图像还原任务调度生成控制命令命令发送12Modularitymodularityisthesingleattributeofsoftwarethatallowsaprogramtobeintellectuallymanageable.Monolithic(整块庞大的)software(i.e.,alargeprogramcomposedofasinglemodule)cannotbeeasilygrasped()byasoftwareengineer.Thenumberofcontrolpaths,spanofreference(引用跨度),numberofvariables,andoverallcomplexitywouldmakeunderstandingclosetoimpossible.Inalmostallinstances,youshouldbreakthedesignintomanymodules,hopingtomakeunderstandingeasierandasaconsequence,reducethecostrequiredtobuildthesoftware.13Modularity:numberofmodulesWhatistherightnumberofmodulesforaspecifics

1 / 30
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功