Supposed I have a flag public static final boolean FLAG
.
In development, I want it to be true
, but in production, I want it to be false
.
Should I just literally set it to true
while developing, and when we build/release, someone would go in and change it to false
?
I have a feeling that's so not the way to go, as it looks horrible.
What is the approach I should take?
Sounds like a good place for a system property, if not a properties file. -Dflag=true
Where -D is part of the line used to start the JVM. On Tomcat its in the JAVA_OPTS environment variable in setenv.sh under bin/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With