Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Represent a dictionary within a dictionary

Tags:

uml

staruml

I am creating UML diagrams that will represent C# code and I've reached somewhat of an impasse. I am currently representing a Dictionary<object, object> by using a qualified association, where the qualification is the key type and the class at the end of the association is the value type.

Now I would like to represent a type in UML, like so: Dictionary<int, Dictionary<object, object>. Is there any type of standard I can use to create a relationship that will accurately represent this relationship?

like image 710
Spencer Avatar asked Feb 04 '26 03:02

Spencer


1 Answers

That line with angle brackets is merely a declaration that says what relations the class will have. You cannot show the declaration in the UML, except in a note (also useful it can be). But you can (and you should) show the relations themselves. Practically, the line Dictionary<int, Dictionary<object, object> can be taken as a strict declaration of a simple class diagram.

enter image description here

like image 176
Gangnus Avatar answered Feb 09 '26 02:02

Gangnus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!