Originally posted by Oguz Ozun:
Hi there,
I have a question from the sample code provided by Andrew. My question is that is there any particular reason for applying Singleton pattern for the class made for managing access to stored parameters on the disk (briefly SavedConfiguration class )? I couldn't get that point.
Thanks in advance ...
Actually, I realized that I couldn't express myself clearly in my previous post. Singleton can be used here. Ok, I got it. We know that in any situation, we need an object dealing with the parameters; therefore, that object can be instantiated eagerly and that object can be used whenever it's needed.
Here, the point that I couldn't get is the reason for use of synchronized block used in saveParametersToFile and loadParametersFromFile methods of SavedConfiguration class.
Is there any setting where more than one
thread could access to the property file?
Thanks in advance ...