Author: rockinthesixstring | Posted on: 2/2/2009 8:08:03 AM | Views : 320

I have never used a Singleton Class before and I now have the need for it in one of my applications I am working on.

The background is that I have an Http Handler that is generating the Config XML for the Slide.Show app found in CodePlex, and a custom WebControl that generates the <object> in my aspx page.  As it sits right now there is a "Background" property in both areas which is a pain since my goal is to be able to dynamically set the properties from my Database.

What I am wondering is, how do I design a Singleton Class where I can pass it the database Table ID and then it can pull the appropriate data from the database so that it can be used by both the HttpHandler and the WebControl without having to make two round trips to the database?

 

Here is my current WebControl (note, I want to move the "Color" property into the singleton)
  Go to the complete details ...