How to properly depict external object on UML diagram?
Suppose you have a Parser
class 开发者_如何学JAVAthat 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.
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:
10.3.1 Artifact (from Artifacts, Nodes)
An artifact is the specification of a physical piece of information that is used or produced by a software development process, or by deployment and operation of a system. Examples of artifacts include model files, source files, scripts, and binary executable files, a table in a database system, a development deliverable, or a word-processing document, a mail message.
精彩评论