Singleton in action
I had one of those 'wow that's cool' moments last weekend. This sounds really sad and you may think that I need a life, but I was playing with the code for a basic singleton pattern found at:-
http://www.dofactory.com/Patterns/PatternSingleton.aspx
I ran it with VS 2005 and stepped in to the code. I have used CamStudio to catch the goodness of this moment so you can all see. Repeat after me...wow.
Watch the screencast here. (I did attempt to have the video embedded on the page, but it took up too much room with this layout)
This is my first screencast, there is no sound so do not adjust your pc. It is hosted by screencast.com which looks to be pretty good video hosting provider.
This is a very simple implementation of the singleton pattern and is not thread safe so should not be used on production code. I will do a video of thread safe singleton using double-check locking after I have calmed down from this experience.