外文翻译UML 20 序列图组合碎片.docx

上传人:b****2 文档编号:1984656 上传时间:2022-10-25 格式:DOCX 页数:8 大小:101.88KB
下载 相关 举报
外文翻译UML 20 序列图组合碎片.docx_第1页
第1页 / 共8页
外文翻译UML 20 序列图组合碎片.docx_第2页
第2页 / 共8页
外文翻译UML 20 序列图组合碎片.docx_第3页
第3页 / 共8页
外文翻译UML 20 序列图组合碎片.docx_第4页
第4页 / 共8页
外文翻译UML 20 序列图组合碎片.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

外文翻译UML 20 序列图组合碎片.docx

《外文翻译UML 20 序列图组合碎片.docx》由会员分享,可在线阅读,更多相关《外文翻译UML 20 序列图组合碎片.docx(8页珍藏版)》请在冰豆网上搜索。

外文翻译UML 20 序列图组合碎片.docx

外文翻译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

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 自然科学 > 生物学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1