Any Java devs that can point me at best practices for global constants? I've a Spring app I've inherited, have to compare some values at runtime against magic strings (customer codes) for some conditional logic, but don't want to embed them deep in the API.

(I'm not a Java developer by trade and haven't really touched it in 20 years.)

Boosts welcome!

May you could put the constant values in a .properties file or get them from a database, so you can change them while the application is running without the need to recompile and redeploy.

Sign in to participate in the conversation
Mental Health dot Social

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!