How to describe a contained map in UML class diagram?

前端 未结 6 1784
迷失自我
迷失自我 2020-12-01 16:10

I have a MyServer class that contains a Map whose keys are MyClientType objects and whose values are MyClient objects. I\'d like to depict this relationship in a class diagr

6条回答
  •  独厮守ぢ
    2020-12-01 16:33

    First of all I and some others think, UML should contain some basic collection types as it did in some earlier versions. They could be taken for example from the OCL...

    The "EMF way" seems right, however it gives imho too much importance to the to type, which is really unimportant imho, so I would model it just as an association class. This will enable you to capture all map specific constraints (as e.g. multiplicity) which can be captured using regular class, but won't make that class as important as the other ones.

提交回复
热议问题