How can I represent a Python dictionary in UML?

后端 未结 1 639
傲寒
傲寒 2020-12-11 09:52

I would like to know how I can represent a Python dictionary using UML. This dictionary is an attribute of a class called Digraph. The keys are of type Node, and the values

相关标签:
1条回答
  • 2020-12-11 10:33

    Qualified associations are useful for modeling maps/dictionaries.

    See uml-diagrams.org for some examples.

    You can also read the official UML (2.5) specs (see page 215)

    And your particular problem can be represented as:

    enter image description here

    However note that this is only for nodes with single outgoing edges (its one-to-one mapping); if this wasn't your intention than the mapping would have to be Node to array of Edges. (and changing 1 into *).

    0 讨论(0)
提交回复
热议问题