hi all,
i am have been developing in VB6 for over 6 years.
I am having a hard time coming to grips with the development environment of
OOP.
The hole concept of not being able to access stuff that i need when i need
it with out loading up a entire class is really bugging me.
So fare in fact it is the most annoying part of this whole learning curve.
i am just trying to make development less time consuming with out effecting
the over program.
i really am open to suggestions but so fare all i have had from anyone is
[Why don't you just create the class when you need it.]
Below are a few things that i would like in my Global variables
public static string APPPATH =
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
public string APP_PATH = APPPATH;
public string LOCAL_DB_PATH = APPPATH + @"\DB\";
public string ERROR_LOG_PATH = APPPATH + @"\Log\";
public string DIALOG_TITLE = "Mitie Cleaning";
public Boolean LOG_ERROR = false;
Now this means that ever time i want to access one of my paths i have to
Write the code to create the class before i can us my Variable and it is the
same with everything else.
if someone has a better suggestion then [just do it the long way like
everyone else] i would love to hear it.
thanks
ink
"Jon Skeet [C# MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> iKiLL <(E-Mail Removed)> wrote:
>> I would like to be able to create an umbrella class for all my main
>> global
>> sections but I would still like to keep them all in separate file
>> something
>> like the below but I keep getting an error saying you are not allowed
>> Multiple base classes.
>
> Indeed you're not. However, I would question your design anyway. Does
> your class really represent something which *is* a StopWatch and *is* a
> Settings, and *is* an ErrorHandler? Or does it just *have* or use those
> things? It sounds to me much more likely that composition is more
> appropriate than inheritance here. (I would also worry about any class
> called GlobalVariables, btw.)
>
> --
> Jon Skeet - <(E-Mail Removed)>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too