dictionary - Represent HashMap in class diagram -


i have class diagram has dictionary (in python terms) attribute. basic structure:

serverentry = { creditcardobj1 : accountbalance1, creditcardobj2 : accountbalance2, ...} 

to clarify, creditcardobj1 instance of class creditcard while accountbalance1 integer value , other entries in dictionary.

i read in java, called hashmap. in case, implement in uml class diagram. tips on how that. using visio 2007 more helpful if can explain in terms of that.

there no single truth , it's merely design decision. here couple variants:

enter image description here

if want represent hash in python application code, can go simple class right tells name represents hash. , don't need implement hash (it's done in python interpreter), fine.

if implement python interpreter, need show details on how that. middle class uses 2 arrays keys , object references. left 1 uses key/object pair bundled in separate class. there more ways show hash implementation.


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -