Saturday, 10 August 2013

What kind of global variable is bad practice in java?

What kind of global variable is bad practice in java?

For many of my java projects, I use database extensively, what I usually
do is to have a property.xml file to hold all my strings and settings.
And then I would have a class CNST to hold all the static constants
corresponding to those in the xml file.
Those constants are initialized by the xml file once when the program
starts, and used as globals anywhere later on in the program.
However, after reading many articles these days, it seems that using
globals at all is not such a good practice. So please can anyone may
indicate a good practice fo this situation? Thanks.

No comments:

Post a Comment