Programming Tip #9 - Do not hard code file/tool configuration references

Most of the time the production environment is not the same as development environment or for that matter similar to your desktop. It is natural when developers work on the desktop, to code to the programs and other tools/technologies that is locally deployed. It is easy to get carried away to do a local test, the references are hard coded. For example the database connection configurations or loading a property file with an absolute path. The first mistake would be to not notice it during the code review. The next stage of mistake is to check in that code in the version control system. And if not scrutinized this code would go all the way to various environments. And if it’s not trivial enough to show up as an error on the screen in the environments it may go all the way up to production environment.

Most of the time the issue shows up when the platforms are totally different. The Windows vs. UNIX environment differences can make the deployment difficult based upon how much of relative coding is done. Added to that is the forward vs. backward slash difference in folder representation, which is not a significant threat if the UNIX standard is followed early on. All said the point is that all these pain points can be avoided if developers can handle the file/tool configuration references relative to the application and separated in a configuration file (properties or xml files).

Blink this Programming Tip #9 - Do not hard code file/tool configuration references at blinklist.com    Bookmark Programming Tip #9 - Do not hard code file/tool configuration references at blogmarks    Bookmark Programming Tip #9 - Do not hard code file/tool configuration references at del.icio.us    Digg Programming Tip #9 - Do not hard code file/tool configuration references at Digg.com    Fark Programming Tip #9 - Do not hard code file/tool configuration references at Fark.com    Bookmark Programming Tip #9 - Do not hard code file/tool configuration references at Furl.net    Bookmark Programming Tip #9 - Do not hard code file/tool configuration references at NewsVine    Bookmark Programming Tip #9 - Do not hard code file/tool configuration references at reddit.com    Bookmark Programming Tip #9 - Do not hard code file/tool configuration references at Simpy.com    Bookmark Programming Tip #9 - Do not hard code file/tool configuration references at Spurl.net    Bookmark Programming Tip #9 - Do not hard code file/tool configuration references with wists    Bookmark Programming Tip #9 - Do not hard code file/tool configuration references at YahooMyWeb

      Cosmos

Leave a Comment

authimage


Creative Commons License  This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.