外文翻译UML 20 序列图组合碎片.docx
- 文档编号:1984656
- 上传时间:2022-10-25
- 格式:DOCX
- 页数:8
- 大小:101.88KB
外文翻译UML 20 序列图组合碎片.docx
《外文翻译UML 20 序列图组合碎片.docx》由会员分享,可在线阅读,更多相关《外文翻译UML 20 序列图组合碎片.docx(8页珍藏版)》请在冰豆网上搜索。
外文翻译UML20序列图组合碎片
中文2270字
UML2.0SequenceDiagramCombinedfragments
Thediagram'spurpose
Thesequencediagramisusedprimarilytoshowtheinteractionsbetweenobjectsinthesequentialorderthatthoseinteractionsoccur.Muchliketheclassdiagram,developerstypicallythinksequencediagramsweremeantexclusivelyforthem.However,anorganization'sbusinessstaffcanfindsequencediagramsusefultocommunicatehowthebusinesscurrentlyworksbyshowinghowvariousbusinessobjectsinteract.Besidesdocumentinganorganization'scurrentaffairs,abusiness-levelsequencediagramcanbeusedasarequirementsdocumenttocommunicaterequirementsforafuturesystemimplementation.Duringtherequirementsphaseofaproject,analystscantakeusecasestothenextlevelbyprovidingamoreformallevelofrefinement.Whenthatoccurs,usecasesareoftenrefinedintooneormoresequencediagrams.
Anorganization'stechnicalstaffcanfindsequencediagramsusefulindocumentinghowafuturesystemshouldbehave.Duringthedesignphase,architectsanddeveloperscanusethediagramtoforceoutthesystem'sobjectinteractions,thusfleshingoutoverallsystemdesign.
Oneoftheprimaryusesofsequencediagramsisinthetransitionfromrequirementsexpressedasusecasestothenextandmoreformallevelofrefinement.Usecasesareoftenrefinedintooneormoresequencediagrams.Inadditiontotheiruseindesigningnewsystems,sequencediagramscanbeusedtodocumenthowobjectsinanexisting(callit"legacy")systemcurrentlyinteract.Thisdocumentationisveryusefulwhentransitioningasystemtoanotherpersonororganization.
Thenotation
SincethisisthefirstarticleinmyUMLdiagramseriesthatisbasedonUML2,weneedtofirstdiscussanadditiontothenotationinUML2diagrams,namelyanotationelementcalledaframe.TheframeelementisusedasabasisformanyotherdiagramelementsinUML2,butthefirstplacemostpeoplewillencounteraframeelementisasthegraphicalboundaryofadiagram.Aframeelementprovidesaconsistentplaceforadiagram'slabel,whileprovidingagraphicalboundaryforthediagram.TheframeelementisoptionalinUMLdiagrams;asyoucanseeinFigures1and2,thediagram'slabelisplacedinthetopleftcornerinwhatI'llcalltheframe's"namebox,"asortofdog-earedrectangle,andtheactualUMLdiagramisdefinedwithinthebodyofthelargerenclosingrectangle.
Inmostsequencediagrams,however,theUML1.x"in-line"guardisnotsufficienttohandlethelogicrequiredforasequencebeingmodeled.ThislackoffunctionalitywasaprobleminUML1.x.UML2hasaddressedthisproblembyremovingthe"in-line"guardandaddinganotationelementcalledaCombinedFragment.Acombinedfragmentisusedtogroupsetsofmessagestogethertoshowconditionalflowinasequencediagram.TheUML2specificationidentifies11interactiontypesforcombinedfragments.
Alternatives
Alternativesareusedtodesignateamutuallyexclusivechoicebetweentwoormoremessagesequences.3Alternativesallowthemodelingoftheclassic"ifthenelse"logic(e.g.,ifIbuythreeitems,thenIget20%offmypurchase;elseIget10%offmypurchase).
AsyouwillnoticeinFigure8,analternativecombinationfragmentelementisdrawnusingaframe.Theword"alt"isplacedinsidetheframe'snamebox.ThelargerrectangleisthendividedintowhatUML2callsoperands.4Operandsareseparatedbyadashedline.Eachoperandisgivenaguardtotestagainst,andthisguardisplacedtowardsthetopleftsectionoftheoperandontopofalifeline.5Ifanoperand'sguardequatesto"true,"thenthatoperandistheoperandtofollow.
Figure8:
Asequencediagramfragmentthatcontainsanalternativecombinationfragment
Asanexampletoshowhowanalternativecombinationfragmentisread,Figure8showsthesequencestartingatthetop,withthebankobjectgettingthecheck'samountandtheaccount'sbalance.Atthispointinthesequencethealternativecombinationfragmenttakesover.Becauseoftheguard"[balance>=amount],"iftheaccount'sbalanceisgreaterthanorequaltotheamount,thenthesequencecontinueswiththebankobjectsendingtheaddDebitTransactionandstorePhotoOfCheckmessagestotheaccountobject.However,ifthebalanceisnotgreaterthanorequaltotheamount,thenthesequenceproceedswiththebankobjectsendingtheaddInsuffientFundFeeandnoteReturnedCheckmessagetotheaccountobjectandthereturnCheckmessagetoitself.Thesecondsequenceiscalledwhenthebalanceisnotgreaterthanorequaltotheamountbecauseofthe"[else]"guard.Inalternativecombinationfragments,the"[else]"guardisnotrequired;andifanoperanddoesnothaveanexplicitguardonit,thenthe"[else]"guardistobeassumed.
Alternativecombinationfragmentsarenotlimitedtosimple"ifthenels
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 外文翻译UML 20 序列图组合碎片 外文 翻译 UML 序列 组合 碎片