Hi.
I was wondering: What do you guys use and why when it comes to coding names that are very unlikely to change, likeDo you use a properties file where you can code something likeCode:setSql("SP_GET_NAME").?Code:setSql(myProps.getProperty("spGetName"));
do you use interfaces or classes with constants where you can do?Code:setSql(myConstants.spGetName);
or do you use resource bundles?
Any preferences?. Here's my take on it:
Having a class/interface that contains constants is useful because if you (for whatever reason) change the name of one property, you will be forced by the compiler to fix it everywhere. If you use properties or bundles you may miss a few and find out about them in production
On the file (properties/bundles) approach, you don't need to recompile the code if you make changes to the properties.
I am still undecided as to what to use. Any preferences out there?
Francisco.



Reply With Quote