The More Things Change...
by in CodeSOD on 2013-05-22Change. It's something we all live with every day. We change our clothes, jobs and sometimes even spouses. Change can be a good thing. Some say not to fear change, but to embrace it! Wisdom tells us to always be prepared for change. Bill U's company likes to be prepared for change.
They have a lot of DAOs to access the data in his company's database. There is a base class that can be extended to make it easier when writing all that annoying, pesky SQL. This class has some helpful functions for getting and closing connections (sane stuff), and then there are the constants for SQL 'literals'. The class contains some helper functions where the constants are used, and some other functions where the constants are not used. This way if they change the database vendor and the definition of a SPACE changes, they can mostly just fix the constants and the data layer will still work.