Singleton Usuage

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
 
D

Dmitriy Lapshin [C# / .NET MVP]

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.
 
S

SF

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top