Reference Data

How to handle reference data? There are well known ids, should the id be used directly in code? What happens when there is logic based on these? What happens when these can be added at runtime?