I have some questions about UML.
Given the following Class Diagram and Object Diagram:
Is it allowed to create in the OD two Persons for the r2d2 Robot ?
Object Diagram:(https://i.sstatic.net/825ydAyT.png)
Class Diagram: (https://i.sstatic.net/FH2QQMVo.png)
And is it allowed to do a composition from an interface to a class?
For example in this class diagram: (https://i.sstatic.net/fXNltH6t.png)
Thank you in advance.
-
I dont think it is possible since there is a 0..1 multiplicity on the person side. So every robot only should have zero or one person.
-
I think it is fine, because you then have to implement the interface description for your class.
Sascha Sigfried is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.