<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Pre- and postconditions for CFML functions?</title>
	<atom:link href="http://riait.co.uk/2008/06/25/pre-and-postconditions-for-cfml-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://riait.co.uk/2008/06/25/pre-and-postconditions-for-cfml-functions/</link>
	<description>just another ria (sort of) weblog...</description>
	<pubDate>Thu, 04 Dec 2008 01:17:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: radekg</title>
		<link>http://riait.co.uk/2008/06/25/pre-and-postconditions-for-cfml-functions/#comment-55</link>
		<dc:creator>radekg</dc:creator>
		<pubDate>Thu, 26 Jun 2008 09:32:55 +0000</pubDate>
		<guid isPermaLink="false">http://riait.co.uk/?p=22#comment-55</guid>
		<description>@todd: it really depends on conditions developer would like to check. the idea is pre- and postcondition attributes should allow any valid CFML expression. it is basically moving test expressions from inside function to well defined attributes but the advantages are what I described. developer does not need see CFML code to know what required/returned values are.
For structures it may be for example:

postcondition="structKeyExists(result,'requiredKey') and len(result.reuquiredKey) gt 2"

for array it could be:

postcondition="arrayLen(result) gt 0"

for query:

postcondition="result.recordCount gt 0"

and so on.</description>
		<content:encoded><![CDATA[<p>@todd: it really depends on conditions developer would like to check. the idea is pre- and postcondition attributes should allow any valid CFML expression. it is basically moving test expressions from inside function to well defined attributes but the advantages are what I described. developer does not need see CFML code to know what required/returned values are.<br />
For structures it may be for example:</p>
<p>postcondition=&#8221;structKeyExists(result,&#8217;requiredKey&#8217;) and len(result.reuquiredKey) gt 2&#8243;</p>
<p>for array it could be:</p>
<p>postcondition=&#8221;arrayLen(result) gt 0&#8243;</p>
<p>for query:</p>
<p>postcondition=&#8221;result.recordCount gt 0&#8243;</p>
<p>and so on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: todd sharp</title>
		<link>http://riait.co.uk/2008/06/25/pre-and-postconditions-for-cfml-functions/#comment-54</link>
		<dc:creator>todd sharp</dc:creator>
		<pubDate>Thu, 26 Jun 2008 00:09:32 +0000</pubDate>
		<guid isPermaLink="false">http://riait.co.uk/?p=22#comment-54</guid>
		<description>It is an interesting proposition, but do you think it is only useful for simple use cases like strings/integers, etc?  How could it be used for objects/arrays/structs/queries?  Would you expect an exception to be thrown if it does not meet the conditions?</description>
		<content:encoded><![CDATA[<p>It is an interesting proposition, but do you think it is only useful for simple use cases like strings/integers, etc?  How could it be used for objects/arrays/structs/queries?  Would you expect an exception to be thrown if it does not meet the conditions?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
