Drawing Call Flow with sequence Diagram leads to ambiguity

放肆的年华 提交于 2019-12-05 15:26:39

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

Self message vs recursive call

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...

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!