




已阅读5页,还剩267页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1,软件架构设计与模式薛君敖博士JunaoXuePh.Dxuejunao2009年12月9-11日,2,讲师介绍,81年赴美,美国哥伦比亚大学电脑科学硕士、物理学博士。85-87在美国芝加哥AT/TBellLaboratory工作期间,参与编写5ESS(超大型交换机)DatabaseRetrofit的数据库架构层面的设计和实施方案,包括:设计和管理安全的数据库架构,设计和管理高可用性解决方案,优化和实施数据库的数据恢复计划,设计、部署和巩固数据库架构。88-94在美国新泽西州AT/TBellLaboratory工作期间,是DACS(大型传输交换连接设备)的Architect组成员,为DACS的逻辑架构、物理架构和系统架构设计提供解决方案,并主持DACS的FSTS(工厂测试系统)系统设计,从硬件基础设施、技术平台、应用平台到应用的设计和实施。之后参与编写SDH和DWDM两大光通讯网络的网管系统(INMS)的逻辑/物理/系统架构设计方案。94-02LucentTechnologiesBellLabsInnovations在任朗讯科技贝尔实验室网管技术支持小组组长兼任原邮电部网管专家顾问期间,为北京,上海,深圳,武汉,南昌等地SDH/DWDM/光网络及网管的设计和实施提供技术解决方案03-06在任“微软-北京邮电大学软件学院-亚鸿世纪软件联合研究中心”副主任、兼任北京亚鸿世纪软件公司总经理和中科软国际部技术顾问期间,为中国电信业提供业务流程重组(BPR)、业务流程管理(BPM)的IT解决方案;领导编写为韩国电信和中国电信用的基于COBIT/ITIL/MOF的IT解决方案,指导开发基于Biztalk和SPS的OSS/BSS已部署在河南通信、威海通信。06-现在普信管理theyareusefulconceptsthatcaptureelementsofanarchiture.Eachistheoutcomeofearlydesigndecisions.,WhatIsSoftwareArchitecture?,94,SoftwareStructures,Thesethreestructurescorrespondtothethreetypesofdecisionthatarchitecturaldesigninvolves:Howisthesystemtobestructuredasasetofcodeunits(modules)?Howisthesystemtobestructuredasasetofelementsthathaveruntimebehavior(components)andinteractions(connectors)?Howisthesystemtorelatetononsoftwarestructuresinitsenvironment(i.e.,CPUs,filesystems,networks,developmentteams,etc.)?,95,ArchitecturalStructuresandViews,Architecturalstructurescanbyandlargebedividedintothreegroups,dependingonthebroadnatureoftheelementstheyshow.Modulestructures.Heretheelementsaremodules,whichareunitsofimplementation.Modulesrepresentacode-basedwayofconsideringthesystem.Theyareassignedareasoffunctionalresponsibility.Thereislessemphasisonhowtheresultingsoftwaremanifestsitselfatruntime.ModulestructuresallowustoanswerquestionssuchasWhatistheprimaryfunctionalresponsibilityassignedtoeachmodule?Whatothersoftwareelementsisamoduleallowedtouse?Whatothersoftwaredoesitactuallyuse?Whatmodulesarerelatedtoothermodulesbygeneralizationorspecialization(i.e.,inheritance)relationships?Component-and-connectorstructures.Heretheelementsareruntimecomponents(whicharetheprincipalunitsofcomputation)andconnectors(whicharethecommunicationvehiclesamongcomponents).Component-and-connectorstructureshelpanswerquestionssuchasWhatarethemajorexecutingcomponentsandhowdotheyinteract?Whatarethemajorshareddatastores?Whichpartsofthesystemarereplicated?Howdoesdataprogressthroughthesystem?Whatpartsofthesystemcanruninparallel?Howcanthesystemsstructurechangeasitexecutes?Allocationstructures.Allocationstructuresshowtherelationshipbetweenthesoftwareelementsandtheelementsinoneormoreexternalenvironmentsinwhichthesoftwareiscreatedandexecuted.TheyanswerquestionssuchasWhatprocessordoeseachsoftwareelementexecuteon?Inwhatfilesiseachelementstoredduringdevelopment,testing,andsystembuilding?Whatistheassignmentofsoftwareelementstodevelopmentteams?,96,ArchitecturalStructuresofaSystem,97,ArchitecturalStructuresofaSystem,98,CreatinganArchitecture,99,ArchitectureandQualityAttributes,Architectureiscriticaltotherealizationofmanyqualitiesofinterestinasystem,andthesequalitiesshouldbedesignedinandcanbeevaluatedatthearchitecturallevel.Architecture,byitself,isunabletoachievequalities.Itprovidesthefoundationforachievingquality,butthisfoundationwillbetonoavailifattentionisnotpaidtothedetails.Qualityattributes:Qualitiesofthesystem.Wewillfocusonavailability,modifiability,performance,security,testability,andusability.Businessqualities(suchastimetomarket)thatareaffectedbythearchitecture.Qualities,suchasconceptualintegrity,thatareaboutthearchitectureitselfalthoughtheyindirectlyaffectotherqualities,suchasmodifiability.,100,Availabilitygeneralscenarios(generation),101,Availabilitygeneralscenariosgeneration,102,(Sample)modifiabilityscenario(generation),103,(Sample)performancescenario(generation),104,(Sample)securityscenario(generation),105,Securityscenariogeneration,106,Sampletestabilityscenario,107,TestabilityGeneralScenarioGeneration,108,Sampleusabilityscenario,109,UsabilityGeneralScenarioGeneration,110,QualityAttributeStimuli,111,BusinessQualities,Timetomarket.Timetomarketisoftenreducedbyusingprebuiltelementssuchascommercialoff-the-shelf(COTS)productsorelementsre-usedfrompreviousprojects.Theabilitytoinsertordeployasubsetofthesystemdependsonthedecompositionofthesystemintoelements.Costandbenefit.Differentarchitectureswillyielddifferentdevelopmentcosts.Anarchitecturethatishighlyflexiblewilltypicallybemorecostlytobuildthanonethatisrigid(althoughitwillbelesscostlytomaintainandmodify).Projectedlifetimeofthesystem.Ifthesystemisintendedtohavealonglifetime,modifiability,scalability,andportabilitybecomeimportant.Amodifiable,extensibleproductismorelikelytosurvivelongerinthemarketplace,extendingitslifetime.Targetedmarket.Portabilityandfunctionalityarekeytomarketshare.Otherqualities,suchasperformance,reliability,andusabilityalsoplayarole.Toattackalargemarketwithacollectionofrelatedproducts,aproductlineapproachshouldbeconsideredinwhichacoreofthesystemiscommon(frequentlyincludingprovisionsforportability)andaroundwhichlayersofsoftwareofincreasingspecificityareconstructed.Rolloutschedule.Ifaproductistobeintroducedasbasefunctionalitywithmanyfeaturesreleasedlater,theflexibilityandcustomizabilityofthearchitectureareimportant.Particularly,thesystemmustbeconstructedwitheaseofexpansionandcontractioninmind.Integrationwithlegacysystems.Ifthenewsystemhastointegratewithexistingsystems,caremustbetakentodefineappropriateintegrationmechanisms.Thispropertyisclearlyofmarketingimportancebuthassubstantialarchitecturalimplications.Thearchitecturalconstraintsimpliedbythisintegrationmustbeanalyzed.,112,Availabilitytactics,113,Modifiabilitytactics,114,Performancetactics,115,Tacticsforsecurity,116,Testabilitytactics,117,Runtimeusabilitytactics,118,DesignTheArchitecture,119,EvolutionaryDeliveryLifeCycle,120,Attribute-drivendesign(ADD),SampleInputBeginningADDADDSteps1ChoosetheModuletoDecompose2.aChoosetheArchitecturalDrivers2.bChooseanArchitecturalPattern2.cInstantiateModulesandAllocateFunctionalityUsingMultipleViewsInstantiatemodulesAllocatefunctionalityRepresentthearchitecturewithviews2.dDefineInterfacesoftheChildModules2.eVerifyandRefineUseCasesandQualityScenariosasConstraintsfortheChildModulesFunctionalrequirementsConstraintsQualityscenarios,121,TheinputtoADDisasetofrequirements.ADDassumesfunctionalrequirements(typicallyexpressedasusecases)andconstraintsasinput,asdootherdesignmethods.However,inADD,wedifferfromthosemethodsinourtreatmentofqualityrequirements.ADDmandatesthatqualityrequirementsbeexpressedasasetofsystem-specificqualityscenarios.Thegeneralscenariosdiscussedinhereactasinputtotherequirementsprocessandprovideachecklisttobeusedindevelopingthesystem-specificscenarios.System-specificscenariosshouldbedefinedtothedetailnecessaryfortheapplication.,SampleInput,122,1.Choosethemoduletodecompose.Themoduletostartwithisusuallythewholesystem.Allrequiredinputsforthismoduleshouldbeavailable(constraints,functionalrequirements,qualityrequirements).2.Refinethemoduleaccordingtothesesteps:a.Choosethearchitecturaldriversfromthesetofconcretequalityscenariosandfunctionalrequirements.Thisstepdetermineswhatisimportantforthisdecomposition.b.Chooseanarchitecturalpatternthatsatisfiesthearchitecturaldrivers.Create(orselect)thepatternbasedonthetacticsthatcanbeusedtoachievethedrivers.Identifychildmodulesrequiredtoimplementthetactics.c.Instantiatemodulesandallocatefunctionalityfromtheusecasesandrepresentusingmultipleviews.d.Defineinterfacesofthechildmodules.Thedecompositionprovidesmodulesandconstraintsonthetypesofmoduleinteractions.Documentthisinformationintheinterfacedocumentforeachmodule.e.Verifyandrefineusecasesandqualityscenariosandmakethemconstraintsforthechildmodules.Thisstepverifiesthatnothingimportantwasforgottenandpreparesthechildmodulesforfurtherdecompositionorimplementation.3.Repeatthestepsaboveforeverymodulethatneedsfurtherdecomposition.,ADDSteps,123,Thefollowingareallmodules:system,subsystem,andsubmodule.Thedecompositiontypicallystartswiththesystem,whichisthendecomposedintosubsystems,whicharefurtherdecomposedintosubmodules.,1a.ChoosetheModuletoDecompose,124,Architecturaldriversarethecombinationoffunctionalandqualityrequirementsthat“shape”thearchitectureortheparticularmoduleunderconsideration.Thedriverswillbefoundamongthetop-priorityrequirementsforthemodule.Thedeterminationofarchitecturaldriversisnotalwaysatop-downprocess.Sometimesdetailedinvestigationisrequiredtounderstandtheramificationsofparticularrequirements.Forexample,todetermineifperformanceisanissueforaparticularsystemconfiguration,aprototypicalimplementationofapieceofthesystemmayberequired.Wewillbaseourdecompositionofamoduleonthearchitecturaldrivers.Otherrequirementsapplytothatmodule,but,bychoosingthedrivers,wearereducingtheproblemtosatisfyingthemostimportantones.Wedonottreatalloftherequirementsasequal;thelessimportantrequirementsaresatisfiedwithintheconstraintsofthemostimportant.ThisisasignificantdifferencebetweenADDandotherarchitecturedesignmethods.,2.aChoosetheArchitecturalDrivers,125,Thegoalofstep2bistoestablishanoverallarchitecturalpatternconsistingofmoduletypes.Thepatternsatisfiesthearchitecturaldriversandisconstructedbycomposingselectedtactics.Twomainfactorsguidetacticselection.Thefirstisthedriversthemselves.Thesecondisthesideeffectsthatapatternimplementingatactichasonotherqualities.Ifwechooseoneexampleofeach:increasecomputationalefficiencyandchooseschedulingpolicy.thenthisyieldsthefollowingtactics:Semanticcoherenceandinformationhiding.Separateresponsibilitiesdealingwiththeuserinterface,communication,andsensorsintotheirownmodules.Wecallthesemodulesvirtualmachinesandweexpectallthreetovarybecauseofthedifferingproductsthatwillbederivedfromthearchitecture.Separatetheresponsibilitiesassociatedwithdiagnosisaswell.Increasecomputationalefficiency.Theperformance-criticalcomputationsshouldbemadeasefficientaspossible.Schedulewisely.Theperformance-criticalcomputationsshouldbescheduledtoensuretheachievementofthetimingdeadline.,2.bChooseanArchitecturalPattern,126,Intheprecedingsection,wediscussedhowthequalityarchitecturaldriversdeterminethedecompositionstructureofamoduleviatheuseoftactics.Asamatteroffact,inthatstepwedefinedthemoduletypesofthedecompositionstep.Wenowshowhowthosemoduletypeswillbeinstantiated.InstantiatemodulesWeidentifiedanon-performance-criticalcomputationrunningontopofavirtualmachinethatmanagescommunicationandsensorinteractions.Thesoftwarerunningontopofthevirtualmachineistypicallyanapplication.Inaconcretesystemwewillnormallyhavemorethanonemodule.Therewillbeoneforeachgroupoffunctionality;thesewillbeinstancesofthetypesshowninthepattern.Ourcriterionforallocatingfunctionalityissimilartothatusedinfunctionality-baseddesignmethods,suchasmostobject-orienteddesignmethods.,2.cInstantiateModulesandAllocateFunctionalityUsingMultipleViews,127,Applyingusecasesthatpertaintotheparentmodulehelpsthearchitectgainamoredetailedunderstandingofthedistributionoffunctionality.Thisalsomayleadtoaddingorremovingchildmodulestofulfillallthefunctionalityrequired.Attheend,everyusecaseoftheparentmodulemustberepresentablebyasequenceofresponsibilitieswithinthechildmodules.Assigningresponsibilitiestothechildreninadecompositionalsoleadstothediscoveryofnecessaryinformationexchange.Thiscreatesaproducer/consumerrelationshipbetweenthosemodules,whichneedstoberecorded.Atthispointinthedesign,itisnotimportanttodefinehowtheinformationisexchanged.Istheinformationpushedorpulled?Isitpassedasamessageoracallparameter?Theseareallquestionsthatneedtobeansweredlaterinthedesignprocess.Atthispointonlytheinformationitselfandtheproducerandconsumerrolesareofinterest.ThisisanexampleofthetypeofinformationleftunresolvedbyADDandresolvedduringdetaileddesign.Sometacticsintroducespecificpatternsofinteractionbetweenmoduletypes.Atacticusinganintermediaryoftypepublish-subscribe,forexample,willintroduceapattern,PublishforoneofthemodulesandapatternSubscribefortheother.Thesepatternsofinteractionshouldberecordedsincetheytranslateintoresponsibilitiesfortheaffectedmodules.Thesestepsshouldbesufficienttogainconfidencethatthesystemcandeliverthedesiredfunctionality.Tocheckiftherequiredqualitiescanbemet,weneedmorethanjusttheresponsibilitiessofarallocated.Dynamicandruntimedeploymentinformationisalsorequiredtoanalyzetheachievementofqualitiessuchasperformance,security,andreliability.Therefore,weexamineadditionalviewsalongwiththemoduledecompositionview.,Allocatefunctionality,128,ADDusesthesethreecommonviews.Moduledecompositionview.Ourdiscussionaboveshowshowthemoduledecompositionviewprovidescontainersforholdingresponsibilitiesastheyarediscovered.Majordataflowrelationshipsamongthemodulesarealsoidentifiedthroughthisview.Concurrencyview.Intheconcurrencyviewdynamicaspectsofasystemsuchasparallelactivitiesandsynchronizationcanbemodeled.Thismodelinghelpstoidentifyresourcecontentionproblems,possibledeadlocksituations,dataconsistencyissues,andsoforth.Modelingtheconcurrencyinasystemlikelyleadstodiscoveryofnewresponsibilitiesofthemodules,whicharerecordedinthemoduleview.Itcanalsoleadtodiscoveryofnewmodules,suchasaresourcemanager,inordertosolveissuesofconcurrentaccesstoascarceresourceandthelike.Theconcurrencyviewisoneofthecomponent-and-connectorviews.Thecomponentsareinstancesofthemodulesinthemoduledecompositionview,andtheconnectorsarethecarriersofvirtualthreads.Avirtualthreaddescribesanexecutionpaththroughthesystemorpartsofit.Thisshouldnotbeconfusedwithoperatingsystemthreads(orprocesses),whichimpliesotherpropertieslikememory/processorallocation.Thosepropertiesarenotofinterestonthelevelatwhichwearedesigning.Nevertheless,afterthedecisionsonanoperatingsystemandonthedeploymentofmodulestoprocessingunitsaremade,virtualthreadshavetobemappedontooperatingsystemthreads.Thisisdoneduringdetaileddesign.Theconnectorsinaconcurrencyviewarethosethatdealwiththreadssuchassynchronizeswith,starts,cancels,andcommunicateswith.Aconcurrencyviewshowsinstancesofthemodulesinthemoduledecompositionviewasameansofunderstandingthemappingbetweenthosetwoviews.Itisimportanttoknowthatasynchronizationpointislocatedinaspecificmodulesothatthisresponsibilitycanbeassignedattherightplace.,Representthearchitecturewithviews,129,-Twousersdoingsimilarthingsatthesametime.Thishelpsinrecognizingresourcecontentionordataintegrityproblems.-Oneuserperformingmultipleactivitiessimultaneously.Thishelpstouncoverdataexchangeandactivitycontrolproblems.-Startingupthesystem.Thisgivesagoodoverviewofpermanentrunningactivitiesinthesystemandhowtoinitializethem.Italsohelpsindecidingonaninitializationstrategy,suchaseverythinginparalleloreverythinginsequenceoranyothermodel.-Shuttingdownthesystem.Thishelpstouncoverissuesofcleaningup,suchasachievingandsavingaconsistentsystemstate.,understandtheconcurrencyinasystem,130,Ifmultipleprocessorsorspecializedhardwareisusedinasystem,additionalresponsibilitiesmayarisefromdeploymenttothehardware.Usingadeploymentviewhelpstodetermineanddesignadeploymentthatsupportsachievingthedesiredqualities.Thedeploymentviewresultsinthevirtualthreadsoftheconcurrencyviewbeingdecomposedintovirtualthreadswithinaparticularprocessorandmessagesthattravelbetweenprocessorstoinitiatethenextentryinthesequenceofactions.Thus,itisthebasisforanalyzingthenetworktrafficandfordeterminingpotentialcongestion.Thedeploymentviewalsohelpsindecidingifmultipleinstancesofsomemodulesareneeded.Forexample,areliabilityrequirementmayforceustoduplicatecriticalfunctionalityondifferentprocessors.Adeploymentviewalsosupportsreasoningabouttheuseofspecial-purposehardware.Thederivationofthedeploymentviewisnotarbitrary.Aswiththemoduledecompositionandconcurrencyviews,thearchitecturedrivershelpdeterminetheallocationofcomponentstohardware.Tacticssuchasreplicationofferameanstoachievehighperformanceorreliabilitybydeployingreplicasondifferentprocessors.Othertacticssuchasareal-timeschedulingmechanismactuallyprohibitdeploymentondifferentprocessors.Functionalconsiderationsusuallyguidethedeploymentofthepartsthatarenotpredeterminedbytheselectedtactics.Thecrossingofavirtualthreadfromoneprocessortoanothergeneratesresponsibilitiesfordifferentmodules.Itindicatesacommunicationrequirementbetweentheprocessors.Somemodulemustberesponsibleformanagingthecommunication;thisresponsibilitymustberecordedinthemoduledecompositionview.,Deploymentview,131,Thefollowinginformationshouldbeavailableinthemodulesinterfacedocumentation:Themoduleviewdocumentsproducers/consumersofinformation.patternsofinteractionthatrequiremodulestoprovideservicesandtousethem.Theconcurrencyviewdocumentsinteractionsamongthreadsthatleadtotheinterfaceofamoduleprovidingorusingaservice.theinformationthatacomponentisactiveforexample,hasitsownthreadrunning.theinformationthatacomponentsynchronizes,sequentializes,andperhapsblockscalls.Thedeploymentviewdocumentsthehardwarerequirements,suchasspecial-purposehardware.sometimingrequirements,suchasthatthecomputationspeedofaprocessorhastobeatleast10MIPS.communicationrequirements,suchasthatinformationshouldnotbeupdatedmorethanonceeverysecond.,2.dDefineInterfacesoftheChildModules,132,2.eVerifyandRefineUseCasesandQualityScenariosasConstraintsfortheChildModules,FunctionalrequirementsConstraintsQualityscenarios,133,Userinterface.Recognizeuserrequestsandtranslatethemintotheformexpectedbytheraising/loweringdoormodule.Raising/loweringdoormodule.Controlactuatorstoraiseorlowerthedoor.Stopthedoorwhenitreacheseitherfullyopenorfullyclosed.Obstacledetection.Recognizewhenanobstacleisdetectedandeitherstopthedescentofthedoororreverseit.Communicationvirtualmachine.Manageallcommunicationwiththehomeinformationsystem.Sensor/actuatorvirtualmachine.Manageallinteractionswiththesensorsandactuators.Scheduler.Guaranteethattheobstacledetectorwillmeetitsdeadlines.Diagnosis.Managetheinteractionswiththehomeinformationsystemdevotedtodiagnosis.,Functionalrequirements,134,Constraints,Constraintsoftheparentmodulecanbesatisfiedinoneofthefollowingways:Thedecompositionsatisfiestheconstraint.Forexample,theconstraintofusingacertainoperatingsystemcanbesatisfiedbydefiningtheoperatingsystemasachildmodule.Theconstrainthasbeensatisfiedandnothingmoreneedstobedone.Theconstraintissatisfiedbyasinglechildmodul
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 甲状腺功能亢进芯片技术-洞察及研究
- 2025年墙纸设计与生产定制合同标准模板
- 2025版投标员实习期间职业道德教育合同
- 2025年健康养生中心经营管理合同范本
- 2025年度房抵工程款光伏组件生产项目合作协议
- 2025年度豪华学区二手房买卖协议
- 2025版全新杂物间租赁及物业管理服务合同文本
- 2025年度企业人才引进与委托培训一体化项目合同
- 2025年船舶保险与运输合同
- 2025二手楼赎楼担保与房产交易合同
- (2025秋)人教版二年级数学上册全册教案(新教材)
- 购物中心突发事件或异常情况处理程序
- 安顺康闽果食品有限公司年产240吨年糕生产线建设项目环评报告
- 邹平梁邹矿业有限公司矿山地质环境保护与土地复垦方案
- 学校宿舍楼建筑装饰工程招标控制价编制技术经济分析
- 外脚手架监理实施细则
- 高考688个高频词汇 word版
- 氟化工艺课件
- 社会调查与统计第四章抽样
- 《国际结算(第五版)》第九章 跨境贸易人民币结算
- 2022年云南师范大学辅导员招聘考试试题及答案解析
评论
0/150
提交评论