Singleton Usuage

  • Thread starter Thread starter Srini
  • Start date Start date
S

Srini

Hi everybody ,
A Couple of weeks back I had asked some practicle
scenarios for using the sigleton pattern.
Most people use the singleton pattern for storing
configuration related data .
Would this not make it difficult to update the cofig data
as the webserver would have to be restarted if there is a
change in the config file.

Regards,
Sromo
 
Hi,
Would this not make it difficult to update the cofig data
as the webserver would have to be restarted if there is a
change in the config file.

Not the webserver - only the Web application I suppose. And you could
probably employ the FileSystemWatcher object to monitor changes in the
configuration file and reload it if necessary.
 
Yes, use a FileSystemWatcher and make sure you update your singleton
threadsafe ...

Dmitriy Lapshin said:
Hi,
Would this not make it difficult to update the cofig data
as the webserver would have to be restarted if there is a
change in the config file.

Not the webserver - only the Web application I suppose. And you could
probably employ the FileSystemWatcher object to monitor changes in the
configuration file and reload it if necessary.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Srini said:
Hi everybody ,
A Couple of weeks back I had asked some practicle
scenarios for using the sigleton pattern.
Most people use the singleton pattern for storing
configuration related data .
Would this not make it difficult to update the cofig data
as the webserver would have to be restarted if there is a
change in the config file.

Regards,
Sromo
 
Back
Top