Re: Add a Hashtable to Applicatoin to save Global data



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
.


Loading