I'm doing a app in android with Rest and observer design pattern, when I do a Rest request I cache the response but some of this response object I want to let the objects in memory permanently until the application is destroyed.
So I have been thinking in create a class with just public static variables (some projects use this kind of class to declare constants Strings) to set them and then I could use it in memory. Something like this:
public class Memory {
public static HashMap<String, PersonDto> people;
// This object could have another complex object as ArrayList or HashMap...
public static LocationsDto locations;
...
}
All I want to know if this could be a bad practice to do what I am trying to solve.