I have a use case wherein I have to get a value from a map, given a key. Now the key can be ID (integer) or Name (string).
I thought about the following structure
map1 :- ID -> value
map2 :- Name -> ID
And hide this structure under a common abstraction, so that either name or ID can be used to retrieve the value.
Is there a better way to do this?