home links tools blog about
home

« VB.NET Sucks | Main | ReverseDOS 2.9 Released »

November 04, 2005

Comments

Brian

I totally agree that as far as patterns go, the singleton is awesome for web apps (I used this twice in my state module recently).

Any particular reason you left the constructor public instead of private or protected? Just wondering (obviously intentional as you pointed this out in your drawback).

Michael K. Campbell

"Any particular reason you left the constructor public instead of private or protected?"

Uhhhh. Cuz my brain was obviously unplugged. I was sorta clued in to that down below... but... well. yeah.

Adam

You really should update this example with concurrency issues addressed.

If your site gets hit with 50 requests at roughly the same time and all spend a millisecond or two in IO operations reading your config file, you'll have your "singleton" get created up to 50 times.

Michael K. Campbell

Good call Adam. Thanks for the feedback.

The comments to this entry are closed.