Reputation: 173
Hi i just start wonder what is better. Always load small data from resources (like dimension, color etc.) or load once when it's neede and put it on some HasMap.
So my question is:
What is better?
1) Always load data from resources. 2) Load data from resources when it's needed. Put this data to HasMap and when we need this resource again, load from this HasMap instead of load from resources.
Upvotes: 0
Views: 137
Reputation: 88
Depends on how many times you are accessing the resources for eg; if by moving from level 1 to level 2, you are not allowing user to go back to level 1, then it is advised to use resources only, but if there are frequent movements between level 1 and level 2, then storing them in hashmap, would be good, because you would have the hashmaps already ready to be used somewhere.
Upvotes: 1