序列图中的方法(Methods in a Sequence Diagram)

编程入门 行业动态 更新时间:2024-10-25 14:31:44
序列图中的方法(Methods in a Sequence Diagram)

我正在创建这个序列图,并想知道要包含哪些方法。 我已经在每个方法中包含了所有方法,例如,

handleCustomerAccountAction()

方法,从另一个名为getListOfCustomers()类中getListOfCustomers()一个方法

这是正确的,或者您只需要包含方法而不是它内部使用的所有方法?

另外,可以在其他方法上多次显示相同的方法吗? 例如,该方法

getListOfCustomers()

显示三次(围绕它的循环),但来自不同的方法。

这是我的序列图的图像:

I am creating this sequence diagram, and wondered exactly what methods to include. I have included all methods in every method, for example, the

handleCustomerAccountAction()

method, got a method from another class called getListOfCustomers()

Is that right to do, or do you only have to include the method and not all the methods it uses inside it?

Also, is it okay to show the same method multiple times on other methods? For example the method

getListOfCustomers()

is shown three times (the one with a loop around it), but from different methods.

Here is the image of my sequence diagram:

最满意答案

它总是取决于你想要展示什么。 SD显示您想要详细解释的某种协作。 SD应该专注于某个方面,并且不得显示每个消息(例如,可以简单地省略某些呼叫分支)。 但是,如果方法在序列中被调用两次,则必须在重要时显示它。

It always depends on what you want to show. A SD shows a certain collaboration you want to explain in detail. A SD should focus on a certain aspect and must not show each and every message (e.g. certain call branches can simply be left out). However, if a method is called twice in a sequence you must show it if it's of importance.

更多推荐

本文发布于:2023-07-29 20:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1319588.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:序列   图中   方法   Diagram   Sequence

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!