仅一个类的序列图
我有一个java类,其中包含所有逻辑。它有10种方法。一切都发生在这个班级里。我该如何建模?或者我如何展示它的功能?我尝试过序列图,但它只调用自身。
建模的最佳解决方案是什么?或者解释一下课程是如何运作的?
I have one java class which has all the logic in it. It has 10 methods. Everything happens in this class. How can I modell it? Or how can I show its functionality? I have tried a sequence diagramm but it only has calls to itself.
What is the best solution to modell it? Or to explain how the class works?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果组件有复杂的内部逻辑,我们经常使用活动图。
http://www.ibm.com/developerworks/rational/library/2802.html 正如您所建议的,序列
图用于描述复杂的、多个组件的顺序操作,其中组件依赖性和调用顺序对于理解至关重要。
然而,当我们想要从逻辑角度描述决策时(在处理单个类时更常见),活动图是一个合适的选择。
In the case where you have complex , internal logic to a component, we often use Activity Diagrams.
http://www.ibm.com/developerworks/rational/library/2802.html
Sequence diagrams, as you have suggested, are used for describing complex, multiple component, sequential operations, where component dependencies and the order of calls is critical for understanding.
However, when we want to describe the decision making from a logical perspective, which is much more often the case when dealing with a single class, Activity Diagrams are an appropriate choice.
您可以选择一种方法并将其反转为序列图。
You can select a method and just reverse it into a sequence diagram.