如何在UML图上正确描述外部对象?
假设您有一个 Parser 类,它读取文件并对其包含的数据执行某些操作。在图表中,如何显示它从某个实体获取数据,该实体不由类表示,而是单独存在,在本例中为文件。
Suppose you have a Parser
class that reads the file and does something with the data it contains. On a diagram how to you show that it gets data from some entity that is not represented by a class, but rather exists separately as, in this example - file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您想显示结构。使用类或接口,因为 UML 并不一定意味着 Java 类,您还可以使用工件,它更多地是部署符号的一部分,但也可以在其他地方使用。如果您考虑一下,文件是一个相当具体的概念,特别是如果它有一个名称。
来自 OMG UML 规范:
Assuming you want to show the structure. Use a class or interface, as UML does not have to mean a Java class, you can also use an artifact which is more part of the deployment notation, but is fine to use elsewhere. If you think about it a file is a fairly concrete concept, especially if it has a name.
From the OMG UML spec: