您好,欢迎访问三七文档
当前位置:首页 > 建筑/环境 > 工程监理 > 软件工程-实践者的研究方法(8)
1Chapter9ArchitecturalDesignSoftwareEngineering:APractitioner’sApproach,7/ebyRogerS.Pressman2WhyArchitecture?Thearchitectureisnottheoperationalsoftware.Rather,itisarepresentationthatenablesasoftwareengineerto:(1)analyzetheeffectivenessofthedesigninmeetingitsstatedrequirements,(2)reducetherisksassociatedwiththeconstructionofthesoftware.(3)representationsofsoftwarearchitectureareanenablerforcommunicationbetweenallparties(stakeholders)interestedinthedevelopmentofacomputer-basedsystem.(4)thearchitecturehighlightsearlydesigndecisionsthatwillhaveanimpactonallsoftwareengineering.3WhatIsArchitecture?Thesoftwarearchitectureofaprogramorsystemisthestructureofthesystem,whichcomprisesoftwarecomponents,theexternalvisiblepropertiesofthosecomponents,andtherelationshipsamongthem.4ArchitecturalDescriptionsTheIEEEComputerSocietyhasproposedIEEE-Std-1471-2000,RecommendedPracticeforArchitecturalDescriptionofSoftware-IntensiveSystem,[IEE00]toestablishaconceptualframeworkandvocabularyforuseduringthedesignofsoftwarearchitecture,toprovidedetailedguidelinesforrepresentinganarchitecturaldescriptionTheIEEEStandarddefinesanarchitecturaldescription(AD)asa“acollectionofproductstodocumentanarchitecture.”5ArchitecturalStylesData-centeredarchitecturesDataflowarchitecturesCallandreturnarchitecturesObject-orientedarchitecturesLayeredarchitectures6Data-CenteredArchitecture7DataFlowArchitecture8CallandReturnArchitecture9LayeredArchitecture10ArchitecturalDescriptions-Example分层技术架构11ArchitecturalDescriptions-Example平台功能架构12ArchitecturalDesignThesoftwaremustbeplacedintocontext(环境)thedesignshoulddefinetheexternalentities(othersystems,devices,people)thatthesoftwareinteractswithandthenatureoftheinteractionAsetofarchitecturalarchetypes(原型)shouldbeidentifiedAnarchetypeisanabstraction(similartoaclass)thatrepresentsoneelementofsystembehaviorThedesignerspecifiesthestructureofthesystembydefiningandrefining(精炼)softwarecomponentsthatimplementeacharchetype13ArchitecturalContexttargetsystem:SecurityFunctionusesusespeershomeownerSafehomeProductInternet-basedsystemsurveillancefunctionsensorscontrolpanelsensorsuses14DefineArchetypeFigure10.7UMLrelationshipsforSafeHomesecurityfunctionarchetypes(adaptedfrom[BOS00])ControllerNodecommunicateswithDetectorIndicator15ComponentStructureSafeHomeExecutiveExternalCommunicationManagementGUIInternetInterfaceFunctionselectionSecuritySurveillanceHomemanagementControlpanelprocessingdetectormanagementalarmprocessing16RefinedComponentStructuresensorsensorsensorsensorsensorsensorsensorsensorExternalCommunicationManagementGUIInternetInterfaceSecurityControlpanelprocessingdetectormanagementalarmprocessingKeypadprocessingCPdisplayfunctionsschedulersensorsensorsensorsensorphonecommunicationalarmSafeHomeExecutive17ADLArchitecturaldescriptionlanguage(ADL)providesasemanticsandsyntaxfordescribingasoftwarearchitectureProvidethedesignerwiththeabilityto:decomposearchitecturalcomponentscomposeindividualcomponentsintolargerarchitecturalblocksandrepresentinterfaces(connectionmechanisms)betweencomponents.18AnArchitecturalDesignMethod表示层业务逻辑层数据存储层客户管理模块表示层业务逻辑层数据存储层订单管理模块表示层业务逻辑层数据存储层库存管理模块1、垂直方向——功能分解——块2、水平方向——服务分层——层19AnArchitecturalDesignMethod20AnArchitecturalDesignMethod“fourbedrooms,threebaths,…”customerrequirementsarchitecturaldesign21DerivingProgramArchitectureProgramArchitecture22PartitioningtheArchitecture“horizontal”and“vertical”partitioningarerequired23Vertical(垂直)Partitioningdefineseparatebranchesofthemodulehierarchyforeachmajorfunctionusecontrolmodulestocoordinatecommunicationbetweenfunctionsfunction1function3function224Horizontal(水平)Partitioningdesignsothatdecisionmakingandworkarestratified(分层)decisionmakingmodulesshouldresideatthetopofthearchitectureworkersdecision-makers25WhyPartitionedArchitecture?resultsinsoftwarethatiseasiertotestleadstosoftwarethatiseasiertomaintainresultsinpropagation(传播)offewersideeffectsresultsinsoftwarethatiseasiertoextend26StructuredDesignobjective:toderiveaprogramarchitectureapproach:aDFDismappedintoaprogramarchitecturethePSPECandSTDareusedtoindicatethecontentofeachmodulenotation:structurechart27FlowCharacteristicsTransformflow(变换中心)TransactionFlow(事务中心)ThiseditionofSEPAdoesnotcovertransactionmapping.ForadetaileddiscussionseetheSEPAwebsite28GeneralMappingApproachisolateincomingandoutgoingflowboundaries;fortransform/transactionflows,isolatethetransform/transactioncenterworkingfromtheboundaryoutward,mapDFDtransform/transformsintocorrespondingmodulesaddcontrolmodulesasrequiredrefinetheresultantprogramstructureusingeffectivemodularityconcepts29GeneralMappingApproachIsolatethetransform/transformcenterbyspecifyingincomingandoutgoingflowboundariesPerformfirst-levelfactoring.”Theprogramarchitecturederivedusingthismappingresultsinatop-downdistributionofcontrol.Factoringleadstoaprogramstructureinwhichtop-levelcomponentsperformdecision-makingandlow-levelcomponentsperformmostinput,computation,andoutputwork.Middle-levelcomponentsperformsomecontrolanddomoderateamountsofwork.P
本文标题:软件工程-实践者的研究方法(8)
链接地址:https://www.777doc.com/doc-212979 .html