I'm working on an ER diagram and I have an entity A composed by two entities B and C with the following contrains: - B and C can exist only inside an entity A both with a relation to A with cardinality one-by-one - Every entity A MUST be composed by an entity B and CAN be also composed by an entity C Given this situation I'm pretty sure I should connect A and B with a relation of composition. But what about C? The fact that C is not compulsory is confusing me: is it possible to show this whole situation in UML? Here's what I think: connect A and C with a relation of composition with a cardinality of: A [1] <---> [0/1] B. Is it the best way? Am I violating the properties of a composition relation?
Yes, you can still use composition in such case, just set multiplicity to 0..1
.