L
Lee
I've been programming with Delphi for the past 4 years or so and while
Delphi does allow globals, I use them very judiciously. I say that I
*do* use them because I think that in some cases they are a good choice.
Now in C# there are no global vars. MSDN and google say that I can use
static classes (err, or static methods in classes) like Type.TypeOf,
etc.
What if I have an object that contains resources for the rest of my
application such as a pre-opened database connection or maybe static
data that makes sense to keep in memory because it's used so often. Is
overriding the constructor of every object in the application the only
(best? Advised?) way of sharing an object accross the application?
Thanks for any clarity..
--
Warm Regards,
Lee
"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."
Delphi does allow globals, I use them very judiciously. I say that I
*do* use them because I think that in some cases they are a good choice.
Now in C# there are no global vars. MSDN and google say that I can use
static classes (err, or static methods in classes) like Type.TypeOf,
etc.
What if I have an object that contains resources for the rest of my
application such as a pre-opened database connection or maybe static
data that makes sense to keep in memory because it's used so often. Is
overriding the constructor of every object in the application the only
(best? Advised?) way of sharing an object accross the application?
Thanks for any clarity..
--
Warm Regards,
Lee
"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."