It all depends? some of my rules of thumb are
for going into a config/resource file
- it's the same for every user, like the path to an image directory
- the data is only needed at the UI level and will not change very often, like a list of US States
- it may vary from server to server, like a resource URL for production vs testing
for going into a DB
- It changes per user or is user specific data
- it may need to be maintained by someone out side your development group
- It's going to be used outside of the UI layer
- it's going to be updated regularly
what ever you do
DON'T HARD CODE STRING INTO YOUR CODE, I don't care how positive you are that the bug report notify Email address will not change, DO NOT HARD CODE IT!!!! or 3 years down the road what would have been a 2 sec config change will result in 2 weeks of work to get an out dated legacy piece of crap application to compile!! or another fun one was an xml-schema hard coded into an application with
stringname += "Schema data";
stringname += "Schema data";
stringname += "Schema data";
Oddly enough same guy, go figure.
No comments:
Post a Comment