Open Li-Zizhen opened 6 months ago
What does it mean for an object diagram to comply with a class diagram? My perspective is that it means the object diagram does not contain any details that would contradict the information provided in a given class diagram.
With that assumption, I think both examples you gave would comply with the given class diagram as nothing about them contradicts the restrictions in the class diagram.
What does it mean for an object diagram to comply with a class diagram? My perspective is that it means the object diagram does not contain any details that would contradict the information provided in a given class diagram.
Almost. In addition, given object diagrams represent object structures that can result while running the system, and the class diagram represents the class structure of the system, an object diagram should also not have anything that is not present in the class diagram.
Given this class diagram, does an object diagram with an object of type not shown in the class diagram comply with this class diagram?
So, this will not be considered as compliant.
object diagrams represent object structures that can result while running the system
I see, that's definitely an important distinction to make. Thanks for the clarification!
Does the empty object diagram comply with every class diagram?
Technically, yes.
Given this class diagram, does an empty object diagram(with not object) comply with this class diagram? Does the empty object diagram comply with every class diagram?
Given this class diagram, does an object diagram with an object of type not shown in the class diagram comply with this class diagram?