gpt4 book ai didi

language-agnostic - 序列图能否以与代码相同的深度真实地捕捉您的逻辑?

转载 作者:行者123 更新时间:2023-12-01 07:12:22 25 4
gpt4 key购买 nike

我一直在使用 UML 序列图,并且熟悉 UML2 表示法。

但我只用它们来捕捉我打算做的事情的本质。换句话说,图总是存在于实际代码之上的抽象级别。每次我用它们来尝试描述 正好我打算做什么我最终使用了如此多的水平空间和如此多的 alt/loop 框架,这不值得付出努力。

所以理论上这是可能的,但有没有人真正使用过这种详细程度的图表?如果是这样,你能提供一个例子吗?

最佳答案

我有同样的问题,但是当我意识到我要低级时,我重新阅读了以下内容:

You should use sequence diagrams when you want to look at the behavior of several objects within a single use case. Sequence diagrams are good at showing collaborations among the objects; they are not so good at precise definition of the behavior.

If you want to look at the behavior of a single object across many use cases, use a state diagram. If you want to look at behavior across many use cases or many threads, consider an activity diagram.

If you want to explore multiple alternative interactions quickly, you may be better off with CRC cards, as that avoids a lot of drawing and erasing. It’s often handy to have a CRC card session to explore design alternatives and then use sequence diagrams to capture any interactions that you want to refer to later.

[excerpt from Martin Fowler's UML Distilled book]

关于language-agnostic - 序列图能否以与代码相同的深度真实地捕捉您的逻辑?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/150445/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com