+ Start a Discussion
Arshadulla ShariffArshadulla Shariff 

Is the following datatype is recommended?

Map<String,Map<String,List<Map<String,List<Map<String,String>>>>>> tempvar = new Map<String,Map<String,List<Map<String,List<Map<String,String>>>>>>();
is there any alterntive or best practise? i am well aware about wrapper classes.
Arshadulla ShariffArshadulla Shariff
Hi please Suggest me the Best practise.
Temoc MunozTemoc Munoz
What is it that you're trying to accomplish? 

From a Maintainability, Flexibility, and Readability perspective, the above is not considred best practice. Plus, every parameter in the Map will require instantiation which is also expensive.

Take a look at this for Java Maps:
http://howtodoinjava.com/core-java/interviews-questions/how-to-design-a-good-key-for-hashmap/
https://docs.oracle.com/cd/A97688_16/generic.903/bp/java.htm#1007137


 
Arshadulla ShariffArshadulla Shariff
Hi Temoc,

Thanks for the anwser,i have complex requriement.
Data will coming From a AggreagteResult soql.
reymagdaongreymagdaong
Kinda of complex, what are you trying to achieve? are you calculatin something, is it form a visualforce?

this looks like a tree of data, you are loading the data structure in the memory with at least 5 levels deep?
maybe you can change your approach to tone down a little bit.