We have a situation where we are ending up using multi-level hash maps; that is, a hash map inside of a hash map, three or four levels deep.
Instinctively this felt wrong somewhere. I have read posts here that talks about how to iterate/use a multi-level hash map, but hardly any of them say what is the best practice for this.
Why are multi level hash maps bad, and what would be the better design, if any?
Here is the sample design of multi-level hash maps that we have:
Map<String, Object1> map1;
class Object1 {
String version;
Map<String,Object2> map2;
}
class Object2 {
Map<String,List<Object3>> map4;
Map<String,String> map5;
}