Most code (and most bugs) are caused by exception handling, such as: if a is checked then input fields 1, 5, 8, and 9 are required else if b is entered then input fields 3, 4, 8 are required else if a is checked and b is checked then fields 1, 3 and 8 are required
(the above is an example of buggy code since the code with the last condition is never executed since the first if a is checked will get executed and then bypass the third condition..just an example of potential bugs)
Is it better to have if/switch statements like the above in code OR to create an exception table where you would pass the conditions (select * where a is checked) and the return values indicate which fields are required (this is a simple example)...
Pros: easier to modify logic in production (update the database), simplification of code Cons: tables and assoc. logic to return the rules could become confusing, performance hit for going to the database for rule processing...
thoughts? anyone have prior experience with the database approach?