A Haunting

gr getting disturbed by seeing hardcoded sys_ids


While writing code, it is tempting to use hard-coded sys_ids of records. However, due to a requirement change or some other similar reason such entries could get deleted. It will result in code trying to access records that no longer exist.

Imagine being a gr trying to navigate through such code statements. It will be haunted by dead records, no wonder if it is troubled.

One really good alternative I saw a colleague of mine use is using default value in a call to getProperty() method in such cases.

gs.getProperty("my.unique.key", "123213ho3h1o321o3u1o3i1oi23j1");


There is also a situation that BR finds itself in due to hard coded values. 




Creative Commons License

Comments