Twice in the past week I found myself needing to create or alter database
search functionality in some APIs for work. In doing this work, I discovered
some techniques that make this process much easier. In line with The
Pragmatic Programmer, I found myself exploring the DRY principle
(Don't Repeat Yourself), and looking into code generation (this time, SQL)
-- basically to exploit my inherent laziness and to make my job easier.
I thought I'd share some of the principles I've discovered for myself as I
haven't read much information on the subject. Some of this may be
rudimentary for some readers or those who work with more advanced
abstraction layers (I suspect DB_DataObject may
do much of this), but hopefully the information can be a useful reference
for others (myself included).