获取 UML 图中的方法和类关系

发布于 2024-12-25 04:19:06 字数 495 浏览 1 评论 0原文

这个问题一遍又一遍地困扰着我,但我找不到明确的答案。对于大多数人来说,回答这个问题应该很简单,所以请您帮我正确使用 UML 好吗?

如果我有类 ABCB 的实例是 A 的成员,C 的实例是 B 的成员。现在B提供了一个方法,该方法返回其类C的成员,并且A在他的一个方法中调用该方法并对其执行一些操作。在 UML 中,AC 之间现在是否存在依赖关系?或者这种关系是否如此明显以至于可以省略(否则 UML 图很快就会变得难以忽视)?为了说明问题,请简要描述所描述的情况:

在此处输入图像描述

This question is bugging me over and over again and I cannot find a clear answer to it. For most people this should be trivial to answer, so please, could you please help me using UML correctly?

If I have classes A, B and C. An instance of B is a member of A and an instance of C is a member of B. Now B offers a method, which returns its member of Class C and A calls this method in one of his methods and does some actions on it. In UML, is there now a dependency between A and C? Or is it so obvious that the relationship can be ommitted (otherwise the UML diagram could become hard to overlook in no time)? To illustrate the problem, a short sketch of the described situation:

enter image description here

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

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

发布评论

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

评论(1

病毒体 2025-01-01 04:19:06

不需要从 A 到 C 的链路。

从 A 到 B 和 B 到 C 的箭头显示可见性(或导航),使得 C 对 B 可见,B 本身对 A 可见,这意味着存在从 A 到 C 的假定路径,并且不需要显式线路被绘制。另外,就像你说的,遵循这种模式会很快创建一个笨拙的图表。

The link from A to C is not needed.

The arrows from A to B and B to C show the visibility (or navigation) such that C is visible to B which is itself visible to A, which means that there is an assumed path from A to C and an explicit line does not need to be drawn. Plus, like you say, following that pattern would quickly create an unwieldy diagram.

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