Forum OpenACS Q&A: Re: Assertions in OpenACS

Collapse
6: Re: Assertions in OpenACS (response to 1)
Posted by Don Baccus on
Other thing we do that reduces the need for assertions is to support rather smart datatype checking and custom data validation blocks for both ad_page_contract and ad_form.

Validation blocks are a form of assertion but return errors in a standard way.

Proper use of datamodel constraints, ad_page_contract, and ad_form datatype and validation features will cover the vast majority of checking that's necessary.

The popularity of explicit assertions is inversely proportional to the built-in assurances of the language being used, IMO.  Which is why they're more popular in the C world than any other place I can think of ...

Certainly use assertions when you think they're useful but only after you've properly designed your datamodel and have used the safety features we provide with tools like ad_page_contract ...