Re: Add a Hashtable to Applicatoin to save Global data
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Sun, 30 Dec 2007 00:32:01 -0800
On Sun, 30 Dec 2007 00:09:59 -0800, Ryan Liu <rliu@xxxxxxxxxxxxx> wrote:
Is that a good idea to add a Hashtable to System.Windows.Forms.Application class? And we can put any user global data in it.
I have some class library used by a few other applications in slight different way. This way (and ocz there are other ways) I don't have to user different parameter to call a method or invent an other global data repository.
What's wrong with just making a static class for your global data? Or a static member of some more-relevant class? (Stored in a Hashtable, or whatever other container you find appropriate, of course).
I mean, I suppose you could use extension to add something to the Application class, but I'm not sure what the point would be. What's so tempting about the Application class that you want to put your data there rather than something more specific to your own code?
Pete
.
- Follow-Ups:
- Re: Add a Hashtable to Applicatoin to save Global data
- From: Peter Duniho
- Re: Add a Hashtable to Applicatoin to save Global data
- References:
- Add a Hashtable to Applicatoin to save Global data
- From: Ryan Liu
- Add a Hashtable to Applicatoin to save Global data
- Prev by Date: Re: service soemtime will get slower -- what to watch
- Next by Date: Re: Add a Hashtable to Applicatoin to save Global data
- Previous by thread: Add a Hashtable to Applicatoin to save Global data
- Next by thread: Re: Add a Hashtable to Applicatoin to save Global data
- Index(es):
Loading