Closed NicolasCwy closed 3 years ago
Yes I think the multiplicity should be 0..1 because there is the option to set to be null. Usually unless something in the questions implies that it is a compulsory association or there is a check for null, it is 0..1.
Yes I think the multiplicity should be 0..1 because there is the option to set to be null. Usually unless something in the questions implies that it is a compulsory association or there is a check for null, it is 0..1.
Correct. In a case like this it is possible that the relationship is intended to be compulsory but the implementation is not very defensive. If this happens in the exam, both answers will be accepted. In a real project, you must find out the intended design and capture that in the diagram.
@damithc @yucheng11122017 Thank you for the clarification
Should the association between box -> item have a multiplicity of
0..1
instead of1
as we are able to instantiate box usingBox box = new Box(null)
.