Drawing Call Flow with sequence Diagram leads to a

2019-05-04 10:10发布

I want to draw a Sequence Diagram Where

A -> B.run()
B.run() -> B.m1()
B.m1() -> B.m2()

So far I've come up with these.

http://i51.tinypic.com/eja5bl.jpg http://i52.tinypic.com/1449s3.jpg

But Here I cannot mention it clearly that B.m2() is called by B.m1() Rather it looks like B.run() Calls both B.m1() and B.m2() serially.

------------- EDIT ----------------

This is What I Currently have drawn http://i55.tinypic.com/21276kk.jpg

http://i55.tinypic.com/21276kk.jpg Well Is my Current Diagram Okay ?? What I want is this. (Call Flow)

SpiritAdapter -> SpiritEngine::run(spirit:string, method:string, args[])
SpiritEngine::run(spirit:string, method:string, args[]) -> SpiritEngine::executeLogic(spirit:string, method:string, args[])
SpiritEngine::executeLogic(spirit:string, method:string, args[]) -> SpiritEngine::spirit(spirit:string, method:string, args[])
SpiritEngine::spirit(spirit:string, method:string, args[]) -> new SpiritAbstractor
SpiritEngine::executeLogic(spirit:string, method:string, args[]) -> SpiritAbstractor::method(args)
SpiritEngine::run(spirit:string, method:string, args[]) -> SpiritEngine::storeXDO()

3条回答
forever°为你锁心
2楼-- · 2019-05-04 10:31

Lets say ObjectA has 3 methods called MessageOne(), MessageTwo() and MessageThree().

And the relation between them are shown below

void ObjectA::MessageOne()
{
    MessageTwo();
}

void ObjectA::MessageTwo()
{
   MessageThree();
}

void ObjectA::MessageThree()
{
   // TODO
}

Using Enterprise Architect as shown in the image below if you select MessageThree() call you will get an option to raise the activation level.

enter image description here

Once you choose that option(By clicking on -> arrow) you will get the exact diagram(Shown below) which satisfy sequence diagram of call stack.

enter image description here

查看更多
等我变得足够好
3楼-- · 2019-05-04 10:34

You can add a small bar over B.m2() and then place a self pointing arrow, for example.

alt text

Self message vs recursive call

alt text

查看更多
放荡不羁爱自由
4楼-- · 2019-05-04 10:45

The uml spec allows for a nested call to be shown visually: the called lifeline should be overlaid on the calling lifeline. See e.g. determineAvailableReport() call in this example.

Whether your tool supports it of course is another matter...

查看更多
登录 后发表回答