• Post Reply Bookmark Topic Watch Topic
  • New Topic

wt is Properties file  RSS feed

 
srinivas yakala
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
could you plzz explain me the use of Properties file exa
ctly in real time scenarios. if possible give the example.

thank you in advance.

regards,
srinivas.
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Properties files are used in numerous places since they allow you to change text attributes without recompiling code. Anytime you see text labels on JSP pages or swing pages for example, such as the "Post A Replay" I see at the top of my page, its a good idea to extract those out to properties files rather than whats referred to as 'hard-coding' them. Hard-coding means that in order to change them, someone must recompile the code.

As you work in larger and larger systems, recompiling the code (performing a build) becomes a big process and re-doing an entire build to change one text label becomes cumbersome. It also allows non-developers to control text labels without having to edit or even read code.

In addition, it is also used to store settings that can be quickly and easily changed during runtime such as database login name or password.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!