Software engineering: an image and a video is a file [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this questionI'm de开发者_高级运维signing an application with UML. I have to represent video and image as a content of my application. I think both of them are files, one of type image and the other of type video.
How can I represent this on an UML model?
Thank you.
Separately from the SE issue, I would challenge your assumption here. Are you sure that a file contains a single image? Are you sure that a video contains a single video? Are you sure that you can only display videos and images from files (rather than, say, a socket or a stream?)
In a UML class diagram, you could model a type for Content, with two subtypes: video and image.
You could separately model a file, and have subtypes for specific file types (or extensions). You could then model the relations between them, including containment. E.g., one video file is associated with one video.
精彩评论