in java, I am reading from a property file into a Properties object:
static Properties fileProp = null; // holds file properties
public static void main( final String[] args ) throws IOException
{
...
//load a properties file
InputStream is = LearnButtonPressHttpHandler.class.getResourceAsStream("/rsrc/file.properties");
fileProp.load(is);
...
// more objects are created
}
later, deeper into the code, several layers deeper, I need to access this properties object but find that I don't have access to this fileProp object. I don't want to pass this object as a parameter down the many layers to where I need it. It would solve the problem but does not seem to be such an elegant solution. Is there a better way?