0

enter image description here

There is a room equipped with a temperature sensor. And the temperature sensor can have 'C or 'F type of temperature by choice. So here are some questions.

  1. Each TSensor is independent, which means tempSensor in Room is just a pointer. In this case, the aggregation is a proper relationship?

  2. Temperature class is instantiated by other classes including TSensor. And it behaves like just a data type. In this case, is Composition a proper relationship?

  • 1
    It's clearly a duplicate. Unfortunately, the most voted answer of that original question is completely wrong and confuses a usage dependency with an association.... The second best answer is also wrong for the same reason. The third answer seems correct but talks a lot about aggregation which has no semantic defined in the UML specs. The fourth one seems acceptable (https://stackoverflow.com/a/34069760/3723423). It's incredible that on such a fundamental topic, there is so much confusion and misleading information – Christophe Oct 11 '21 at 17:37

0 Answers0