How can I represent a Python dictionary in UML?

I would like to know how I can represent a Python dictionary using UML. This dictionary is an attribute of the Digraph class. Keys are of type Node and values ​​are of type Edge.

+1


source to share


1 answer


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 specific problem can be represented as:

enter image description here

Note, however, that this is only for nodes with single outgoing edges (its one-to-one mapping); if that wasn't your intention as the mapping would have to be Node to Edges array. (and changing 1

to *

).

+1


source







All Articles