• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

text messages

 
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another question on ways people have done something... text messages (like for messages to the user).
1) Just put them in the code
2) Have one big constants java file with the messages
3) Text file like an ApplicationResources.properties file (we use them with our struts code)
Thanks again,
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am wondering as well. Indeed i used the properties file and constant java file approach. The constants file contains all static final keys to the properties file (Including methods for getAllProperties, saveProperties(properties) and getProperty(key, default))
If properties are not there then obviously the default is returned, which is hardcoded.
But i am not sure on this approach, seems like a lot of overhead. On the other hand, it is very easy to change the message or to add another error code and message.
Like i said i am not sure so i am also interested how other people have done this.
 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it's OK to leave text messages in the code. That's what Sun did in its Data class.
 
Their achilles heel is the noogie! Give them noogies tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic