序列图子函数

发布于 2025-01-08 15:45:11 字数 353 浏览 3 评论 0原文

好吧,我正在研究序列图,当我发现某个函数可能是用户可能执行的完整流程的独立函数,并且它可能是更大流程的子流程(例如
)时,我感到很困惑
第一个过程:“historyClassRegistration(studentId)”
第二个过程:“allClassesRegistration(studentId)”

学生只能注册历史课
他还可以注册所有类,其中包括“historyClassRegistration”过程

问题是:
我应该单独绘制“historyClassRegistration”流程及其子流程,然后使用“allClassesRegistration”中的子流程再次重新绘制它,或者我能做什么???

Well, I'm working on sequence diagram and I got confused when I found a some function could be a standalone function for a complete process the user may do, and it could be a sub process of a bigger process like

the first process: "historyClassRegistration(studentId)"
the second process: "allClassesRegistration(studentId)"

the student can register only history class
also he can register all classes which includes "historyClassRegistration" process inside

the question is:
should I draw the "historyClassRegistration" process alone with it's sub-processes and redraw it again with it's sub-processes in "allClassesRegistration", or what can I do???

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧瑾黎汐 2025-01-15 15:45:11

我认为这可能取决于序列图试图演示的用例。
它还取决于系统的结构。

如果我能控制设计,第一个操作可能就不会存在。所注册的类的类型似乎应该是一个参数,除非类之间的注册过程完全不同。

如果您的图表显示学生注册所有课程,那么只会有一个 student.registerForClass(class) 操作的循环。

如果您的图表要显示 allClassesRegistration(studentId) 操作的内部执行,那么您可能会显示一个带有循环的图表,例如 classRegister.register(studentID, Class)

如果是专门显示学生注册历史课,那么实际上是使用 class = History 调用 student.registerForClass(class) 的场景。然后,您可以更详细地显示学生正在注册的对象所发生的情况。

I think it probably depends on what use case the sequence diagram is trying to demonstrate.
It will also depend on the structure of the system.

If I had control of the design, the first operation would probably not exist. The type of class being registered for seems like it should be a parameter, unless the process for registering for classes is radically different between classes.

If your diagram was to show a student registering for all classes then there would just be a loop over a student.registerForClass(class) operation.

If your diagram was to show the internal execution of the allClassesRegistration(studentId) operation, then you might show a diagram with a loop over something like classRegister.register(studentID, Class).

If it was to specifically show a student registering for a history class, its really a scenario in which the student.registerForClass(class) is called with class = history. You might then show more detail of what happens to the object with which the student is registering.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文