java - Using Constants OR System Properties -


i working on rest api project , using websphere application server 8.5 deployment. there string attributes country_name , company_name etc, same throughout application.

currently have created constants class maintaining constants using public static final variables. of team mates on modules, adding these constants entries in websphere environment variables , getting them using system.getproperty().

what thinking problem in system.getproperty() way makes app dependent on websphere server, mine constants file in application itself, making standalone, without dependency server.

but on other hand, if want change attribute value, need create new ear file of app & redeploy, while in case of system.getproperty() change can done in server, without redeployment.

so way should move forward. using constants file or system.getproperty().

storing constants in dedicated class or interface not recommended. see what best way implement constants in java? related discussion.

imo, having constants configured resource files better approach because avoids need change code in case constants value need changed.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -