Hi:
I am frequently faced with a question of how to set states in my application. Things like...is the load complete? should a text box behave one way or another? Things that depend on the state data persisting outside the method/event handler in question. No problem, just set a class variable global to the form and problem solved.
However, my boss is wanting me to get rid of as many of these global variables as possible...I am accomplishing some of this through encapsulation. However, things like the load event being complete...or other functionality that depends on the state data is a harder nut to crack. Normally, this wouldn't be that much of a bad thing...but most of our applications revolve around one form...all other things spring from this parent form and well, the functionality can be come quite intricate depending on our users and specific application.
I would be interested on hearing anyone else's thoughts on how to get rid of global variables, but retain the state data that events/methods are dependant on.
Thanks!
Eric
I am frequently faced with a question of how to set states in my application. Things like...is the load complete? should a text box behave one way or another? Things that depend on the state data persisting outside the method/event handler in question. No problem, just set a class variable global to the form and problem solved.
However, my boss is wanting me to get rid of as many of these global variables as possible...I am accomplishing some of this through encapsulation. However, things like the load event being complete...or other functionality that depends on the state data is a harder nut to crack. Normally, this wouldn't be that much of a bad thing...but most of our applications revolve around one form...all other things spring from this parent form and well, the functionality can be come quite intricate depending on our users and specific application.
I would be interested on hearing anyone else's thoughts on how to get rid of global variables, but retain the state data that events/methods are dependant on.
Thanks!
Eric