• Post Reply Bookmark Topic Watch Topic
  • New Topic

Should constants go in resource bundle  RSS feed

 
Ajay Kamble
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

We have a JSF application and we use resource bundle for static text that is to be displayed on JSP pages.

Is it advisable to put constant values as well in resource bundle files (considering that any non Java person can also do the change)?

For example, consider below constant,



It is already a constant and if it changes we will do change at only 1 place. Still should we go ahead and put such constants in resource bundle files?

-Regards
Ajay
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajay Kamble wrote:Is it advisable to put constant values as well in resource bundle files (considering that any non Java person can also do the change)?

As usual, with a question like this, the answer is: it depends.

1. Do you want non-Java people changing these values?
2. Are they likely to change (ie, are they really 'configuration' items)?
3. Do they give people access to information that they shouldn't have?

Unfortunately, only you can answer those questions (and there are probably several that I've missed). If the answers suggest that that's the place for them, then I don't see any reason why you shouldn't put them in there.

Winston
 
Ajay Kamble
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Winston.

I will use your explanation to find the answer.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajay Kamble wrote:Thank you Winston.
I will use your explanation to find the answer.

You're welcome, and good luck.

Winston
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What effect does changing TARGET_PAGE have on the application? The answer to this should give an indication as to whether or not you want a non-technical person changing this value.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!