Search code examples
constraintsumlassociationsclass-diagrammultiplicity

What is the exact meaning of {xor} in this specific situation?


so I am currently studying for an exam and this image was taken from an older one. So my question is the following: Does {xor} mean that E NEEDS either 1 or more objects of class A or 1 or more objects of class B. Or could it be that it doesnt need any references to any of them, because the multiplicity is 0..* for both. And the task is to create the smallest object-diagram possible, so do I need A/B or not?

(English is not my main language so if anything is unclear please ask me about it)

enter image description here


Solution

  • Well, quite simple. D has either a relation to A or B. No relation and relations to both are invalid (that's what the xor logic table tells us). However, it could as well mean that no relation is allowed too (if the author isn't explicit here). Instead of {xor} it would be better to write some short more explanatory text (admittedly I used it also with {xor} in the past). Tell that to the diagram author ;-)