Forum OpenACS Q&A: Re: Assertions in OpenACS

Collapse
3: Re: Assertions in OpenACS (response to 1)
Posted by Don Baccus on
One thing we do that diminishes, at least, the need for assertions in the code is to enthusiastically embrace SQL constraints in the datamodel, and triggers to maintain various relationships between columns and tables.

Good datamodel design of this sort make impossible whole classes of errors.

A problem with assertions in Tcl is that they're always executed - there's no equivalent of "ifdef" which allows one to turn them on or off (you could have your proc not evaluate your assertion clause unless assertions are enabled, but there's no way to remove the proc call itself).