Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global Objects
Message
From
03/09/2007 15:05:33
 
 
To
03/09/2007 12:45:03
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01251812
Message ID:
01252027
Views:
20
>John,
>
>Another part of your question mentioned Not wanting to instanitate the class every time you needed to access the settings data. There is a design pattern called the Singleton Design Pattern that addresses this issue also. Essentially the class itself can check to see if has already been instantiated before calling the constructor. I use a variation of what Rick mentioned where I have a settings class that uses the singelton design pattern. I instantiate the settings class from my main application object but can get a reference to it from anyother class as needed without creating another instance. Within this settings class all the settings properties are static and read from xml file or database or ?.
>Tim

More cool data.

Taking me a bit to research the difference between when to use singleton and when to use static classes, but I'm getting it slowly.

I have a number of cases where singleton may make sense for me, I will have to play with it some more.

Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform