<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.clearcrystalmedia.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Polymorphism</title>
	
	<link>http://www.clearcrystalmedia.com/pm</link>
	<description>using the right technology at the right time</description>
	<lastBuildDate>Mon, 08 Mar 2010 11:41:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.clearcrystalmedia.com/polymorphism" /><feedburner:info uri="polymorphism" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>39.965131</geo:lat><geo:long>-83.004316</geo:long><feedburner:emailServiceId>polymorphism</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Does exactly what it says on the tin</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/V94nweuI_p4/</link>
		<comments>http://www.clearcrystalmedia.com/pm/ronseal-test-method-naming/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 18:39:57 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[cfwheels]]></category>
		<category><![CDATA[chris peters]]></category>
		<category><![CDATA[clear crystal media]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[coldfusion on wheels]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=439</guid>
		<description><![CDATA[<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/HA_qxAWCwqI&#38;hl=en_US&#38;fs=1&#38;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/HA_qxAWCwqI&#38;hl=en_US&#38;fs=1&#38;" allowscriptaccess="always" allowfullscreen="true"></embed></object>
<p>"Does exactly what it says on the tin."</p>
<p>I love it. All of our method and function names should do exactly the same.</p>
<p>Read on for more context and why Andy Bellenie is a genius.</p>]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/HA_qxAWCwqI&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/HA_qxAWCwqI&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>&#8220;Does exactly what it says on the tin.&#8221;</p>
<p>I love it. All of our method and function names should do exactly the same.</p>
<p>During a discussion with the <a href="http://cfwheels.org/community/core-team">ColdFusion on Wheels core team</a> about the <code><a href="http://cfwheels.org/docs/function/valid">valid()</a></code> and <code><a href="http://cfwheels.org/docs/function/beforevalidation">beforeValidation()</a></code> methods, <a href="http://cfwheels.org/user/profile/24">Andy Bellenie</a> made this remark:</p>
<blockquote><p>My point is that a callback called <code>beforeValidation</code> should run, well, before validation &#8211; not during it. This seems self-evident to me and I&#8217;d have a hard time explaining to anyone why it should work differently.</p></blockquote>
<p>Then he pointed to &#8220;the <a title="Ronseal TV Advert - Ronseal Quick Drying Woodstain" href="http://www.youtube.com/watch?v=HA_qxAWCwqI">Ronseal test</a>, the holy grail of method naming.&#8221;</p>
<p>Thanks Andy for the inspiration.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/best+practices' rel='tag' target='_self'>best practices</a>, <a class='technorati-link' href='http://technorati.com/tag/cfwheels' rel='tag' target='_self'>cfwheels</a>, <a class='technorati-link' href='http://technorati.com/tag/chris+peters' rel='tag' target='_self'>chris peters</a>, <a class='technorati-link' href='http://technorati.com/tag/clear+crystal+media' rel='tag' target='_self'>clear crystal media</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion' rel='tag' target='_self'>ColdFusion</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+on+wheels' rel='tag' target='_self'>coldfusion on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/development' rel='tag' target='_self'>development</a>, <a class='technorati-link' href='http://technorati.com/tag/polymorphism' rel='tag' target='_self'>polymorphism</a>, <a class='technorati-link' href='http://technorati.com/tag/Programming' rel='tag' target='_self'>Programming</a>, <a class='technorati-link' href='http://technorati.com/tag/web+development' rel='tag' target='_self'>web development</a></p>

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/V94nweuI_p4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/ronseal-test-method-naming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/ronseal-test-method-naming/</feedburner:origLink></item>
		<item>
		<title>First step in throwing your XHTML document into Quirks Mode</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/SmVxyd_n5Hw/</link>
		<comments>http://www.clearcrystalmedia.com/pm/xhtml-document-quirks-mode/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 15:24:38 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[Career & Lifestyle]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Design & CSS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[ccm]]></category>
		<category><![CDATA[cfml]]></category>
		<category><![CDATA[chris peters]]></category>
		<category><![CDATA[clear crystal media]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[quirks mode]]></category>
		<category><![CDATA[railo]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[standards compliance]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=430</guid>
		<description><![CDATA[<p>A lot of websites pursue <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> as their document type, which is really cool. But a lot of them end up not validating with one little mistake. Even worse, with this mistake, documents that are made to run in "standards mode" are immediately thrown into <a href="http://www.quirksmode.org/css/quirksmode.html">quirks mode</a> by browsers because web developers don't know how to do their jobs.</p>
<p>Read on to find out how to avoid this all-too-common mistake.</p>]]></description>
			<content:encoded><![CDATA[<p>A lot of websites pursue <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> as their document type, which is really cool. But a lot of them end up not validating with one little mistake. Even worse, with this mistake, documents that are made to run in &#8220;standards mode&#8221; are immediately thrown into <a href="http://www.quirksmode.org/css/quirksmode.html">quirks mode</a> by browsers because web developers don&#8217;t know how to do their jobs.</p>
<p>If you want to author <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> documents, your <code>DOCTYPE</code> declaration must start on the <a href="http://www.personal.psu.edu/v23/presentations/accessibility/20errors/standards_errors.html#error14">first character of the first line</a> of the source code. No leading spaces or line breaks.</p>
<p>My favorite is how ASP.NET breaks this by following their practices. Take the <a href="http://en.wikipedia.org/wiki/ASP.NET" title="ASP.NET">example from Wikipedia</a> (which I&#8217;ve seen used elsewhere as well):</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;%</span>@ Page Language<span style="color: #008000;">=</span><span style="color: #666666;">&quot;C#&quot;</span> <span style="color: #008000;">%&gt;</span>   
&nbsp;
<span style="color: #008000;">&lt;!</span>DOCTYPE html <span style="color: #0600FF;">PUBLIC</span> <span style="color: #666666;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #666666;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&lt;</span>script runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span><span style="color: #008000;">&gt;</span></pre></div></div>

<p>This causes developers to insert 2 line breaks before the <code>DOCTYPE</code>, which is unacceptable if you want to comply with standards.</p>
<p>Because my weapon of choice is <abbr title="ColdFusion Markup Language">CFML</abbr>, here&#8217;s how I handle this situation using <code>&lt;cfsetting&gt;</code> and <code>&lt;cfoutput&gt;</code> tags in my layout files:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfsetting</span> enablecfoutputonly<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;true&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;layout.title&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;string&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;otherParams&quot;</span> <span style="color: #0000FF;">default</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;here&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> variablesThatNeedSet <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;here&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">head</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">title</span><span style="color: #0000FF;">&gt;</span></span><span style="color: #0000FF;">#layout.<span style="color: #0000FF;">title</span>#</span><span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">title</span><span style="color: #0000FF;">&gt;</span></span>
...
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">head</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfsetting</span> enablecfoutputonly<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>Because ColdFusion suppresses output until the opening <code>&lt;cfoutput&gt;</code> tag, the <code>DOCTYPE</code> will appear on the first character of the first line, right where it belongs. And browsers will treat the document as standards compliant, not in quirks mode.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/asp.net' rel='tag' target='_self'>asp.net</a>, <a class='technorati-link' href='http://technorati.com/tag/ccm' rel='tag' target='_self'>ccm</a>, <a class='technorati-link' href='http://technorati.com/tag/cfml' rel='tag' target='_self'>cfml</a>, <a class='technorati-link' href='http://technorati.com/tag/chris+peters' rel='tag' target='_self'>chris peters</a>, <a class='technorati-link' href='http://technorati.com/tag/clear+crystal+media' rel='tag' target='_self'>clear crystal media</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion' rel='tag' target='_self'>ColdFusion</a>, <a class='technorati-link' href='http://technorati.com/tag/html' rel='tag' target='_self'>html</a>, <a class='technorati-link' href='http://technorati.com/tag/polymorphism' rel='tag' target='_self'>polymorphism</a>, <a class='technorati-link' href='http://technorati.com/tag/quirks+mode' rel='tag' target='_self'>quirks mode</a>, <a class='technorati-link' href='http://technorati.com/tag/railo' rel='tag' target='_self'>railo</a>, <a class='technorati-link' href='http://technorati.com/tag/standards' rel='tag' target='_self'>standards</a>, <a class='technorati-link' href='http://technorati.com/tag/standards+compliance' rel='tag' target='_self'>standards compliance</a>, <a class='technorati-link' href='http://technorati.com/tag/web+standards' rel='tag' target='_self'>web standards</a>, <a class='technorati-link' href='http://technorati.com/tag/xhtml' rel='tag' target='_self'>xhtml</a></p>

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/SmVxyd_n5Hw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/xhtml-document-quirks-mode/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/xhtml-document-quirks-mode/</feedburner:origLink></item>
		<item>
		<title>Up and rolling with Git on Snow Leopard</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/5N8vFlQODOA/</link>
		<comments>http://www.clearcrystalmedia.com/pm/git-snow-leopard/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 15:34:42 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[ccm]]></category>
		<category><![CDATA[cfwheels]]></category>
		<category><![CDATA[chris peters]]></category>
		<category><![CDATA[clear crystal media]]></category>
		<category><![CDATA[coldfusion on wheels]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[version control]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=425</guid>
		<description><![CDATA[<p>This morning, I set up a <a href="http://github.com/clearcrystalmedia">GitHub account</a> so that I could have some public repositories for my <a href="http://cfwheels.org/plugins/">ColdFusion on Wheels plugins</a>. Feel free to follow me and watch my repositories as I post them up. (Gotta learn how to do that first though!)</p>
<p>Read on for a summary of how I installed my local copy of Git on Snow Leopard.</p>]]></description>
			<content:encoded><![CDATA[<p>This morning, I set up a <a href="http://github.com/clearcrystalmedia">GitHub account</a> so that I could have some public repositories for my <a href="http://cfwheels.org/plugins/">ColdFusion on Wheels plugins</a>. Feel free to follow me and watch my repositories as I post them up. (Gotta learn how to do that first though!)</p>
<p>Then came the process of installing Git on Snow Leopard so that my computer can talk to the repository. In my opinion, the Git website could do a better job with their Mac OS X installer (or at least the instructions).</p>
<p>Fortunately, Hivelogic has a great step-by-step on <a href="http://hivelogic.com/articles/compiling-git-on-snow-leopard/">installing Git on Snow Leopard</a>. If you&#8217;re running Snow Leopard, I highly recommend doing everything that they say in the post. If they ask you to touch your nose while spinning in circles, do it.</p>
<p>Now on to figuring out how to get my <a href="http://cfwheels.org/plugins/listing/19">reCAPTCHA on Wheels</a> plugin into my new repo.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/ccm' rel='tag' target='_self'>ccm</a>, <a class='technorati-link' href='http://technorati.com/tag/cfwheels' rel='tag' target='_self'>cfwheels</a>, <a class='technorati-link' href='http://technorati.com/tag/chris+peters' rel='tag' target='_self'>chris peters</a>, <a class='technorati-link' href='http://technorati.com/tag/clear+crystal+media' rel='tag' target='_self'>clear crystal media</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+on+wheels' rel='tag' target='_self'>coldfusion on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/Git' rel='tag' target='_self'>Git</a>, <a class='technorati-link' href='http://technorati.com/tag/github' rel='tag' target='_self'>github</a>, <a class='technorati-link' href='http://technorati.com/tag/install' rel='tag' target='_self'>install</a>, <a class='technorati-link' href='http://technorati.com/tag/installation' rel='tag' target='_self'>installation</a>, <a class='technorati-link' href='http://technorati.com/tag/polymorphism' rel='tag' target='_self'>polymorphism</a>, <a class='technorati-link' href='http://technorati.com/tag/scm' rel='tag' target='_self'>scm</a>, <a class='technorati-link' href='http://technorati.com/tag/version+control' rel='tag' target='_self'>version control</a>, <a class='technorati-link' href='http://technorati.com/tag/web+development' rel='tag' target='_self'>web development</a></p>

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/5N8vFlQODOA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/git-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/git-snow-leopard/</feedburner:origLink></item>
		<item>
		<title>Using extra CFC attributes for documentation</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/8309nbKrM2I/</link>
		<comments>http://www.clearcrystalmedia.com/pm/extra-cfc-attributes-documentation/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 21:57:02 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion on Wheels]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[ccm]]></category>
		<category><![CDATA[cfml]]></category>
		<category><![CDATA[cfwheels]]></category>
		<category><![CDATA[chris peters]]></category>
		<category><![CDATA[clear crystal media]]></category>
		<category><![CDATA[coldfusion on wheels]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[railo]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=412</guid>
		<description><![CDATA[<p>For the <a href="http://cfwheels.org/docs">ColdFusion on Wheels <abbr title="Application Programming Interface">API</abbr> documentation</a>, we chose to do something a little unconventional (but pretty cool). Using some extra <abbr title="ColdFusion Component">CFC</abbr> attributes and <abbr title="ColdFusion Markup Language">CFML</abbr>'s <code><a href="http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7dd9.html">GetMetaData()</a></code> function, we wrote a pretty cool documentation parser for ColdFusion on Wheels.</p>
<p>Read on for an example of what we did.</p>]]></description>
			<content:encoded><![CDATA[<p>For the <a href="http://cfwheels.org/docs">ColdFusion on Wheels <abbr title="Application Programming Interface">API</abbr> documentation</a>, we chose to do something a little unconventional (but pretty cool). Instead of trying to write or use a comment parser for our documentation, we just added additional attributes to our <abbr title="ColdFusion Component">CFC</abbr>s&#8217; <code>&lt;cffunction&gt;</code> tags.</p>
<p>Look at this example for the <a href="http://cfwheels.org/docs/function/autolink"><code>autoLink()</code></a> view helper:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;autoLink&quot;</span> returntype<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000FF;">access</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;public&quot;</span> output<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span> <span style="color: #0000FF;">hint</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Turns all URLs and e-mail addresses into clickable links.&quot;</span></span>
<span style="color: #333333;">    examples<span style="color: #0000FF;">=</span></span>
<span style="color: #333333;">        <span style="color: #009900;">'</span>
<span style="color: #333333;">            ##autoLink(&quot;Download Wheels from http://cfwheels.org/download&quot;)##</span>
<span style="color: #333333;">            -&gt; Download Wheels from &lt;a href=&quot;http://cfwheels.org/download&quot;&gt;http://cfwheels.org/download&lt;/a&gt;</span>
&nbsp;
<span style="color: #333333;">            ##autoLink(&quot;Email us at info@cfwheels.org&quot;)##</span>
<span style="color: #333333;">            -&gt; Email us at &lt;a href=&quot;mailto:info@cfwheels.org&quot;&gt;info@cfwheels.org&lt;/a&gt;</span>
<span style="color: #333333;">        '</span></span>
<span style="color: #333333;">    categories<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;view-helper,text&quot;</span> functions<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;excerpt,highlight,simpleFormat,titleize,truncate&quot;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&gt;</span></span>
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfargument</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;text&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000FF;">required</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000FF;">hint</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;The text to create links in.&quot;</span><span style="color: #0000FF;">&gt;</span></span>
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfargument</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;link&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000FF;">required</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span> <span style="color: #0000FF;">default</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;all&quot;</span> <span style="color: #0000FF;">hint</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;Whether to link URLs, email addresses or both. Possible values are: `all` (default), `URLs` and `emailAddresses`.&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
            var loc = {};
            loc.urlRegex = &quot;(?ix)([^(url=)|(href=)'&quot;&quot;])(((https?)://([^:]+\:[^@]*@)?)([\d\w\-]+\.)?[\w\d\-\.]+\.(com|net|org|info|biz|tv|co\.uk|de|ro|it)(( / [\w\d\.\-@%\\\/:]* )+)?(\?[\w\d\?%,\.\/\##!@:=\+~_\-&amp;amp;]*(?<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span>!<span style="color: #0000FF;">&#91;</span>\.<span style="color: #0000FF;">&#93;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&#41;</span>?<span style="color: #0000FF;">&#41;</span><span style="color: #009900;">&quot;;</span>
<span style="color: #333333;">            loc.mailRegex = &quot;</span><span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#91;</span>^@\s<span style="color: #0000FF;">&#93;</span>+<span style="color: #0000FF;">&#41;</span>@<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#40;</span>?:<span style="color: #0000FF;">&#91;</span>-a-z0-<span style="color: #FF0000;">9</span><span style="color: #0000FF;">&#93;</span>+\.<span style="color: #0000FF;">&#41;</span>+<span style="color: #0000FF;">&#91;</span>a-z<span style="color: #0000FF;">&#93;</span><span style="color: #0000FF;">&#123;</span><span style="color: #FF0000;">2</span>,<span style="color: #0000FF;">&#125;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&#41;</span><span style="color: #009900;">&quot;;</span>
<span style="color: #333333;">            loc.returnValue = arguments.text;</span>
<span style="color: #333333;">            if (arguments.link != &quot;</span>emailAddresses<span style="color: #009900;">&quot;)</span>
<span style="color: #333333;">                loc.returnValue = loc.returnValue.ReplaceAll(loc.urlRegex, &quot;</span>$<span style="color: #FF0000;">1</span><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">a</span> <span style="color: #0000FF;">href</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;&quot;</span>$<span style="color: #FF0000;">2</span><span style="color: #009900;">&quot;&quot;</span><span style="color: #0000FF;">&gt;</span></span>$2<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">a</span><span style="color: #0000FF;">&gt;</span></span>&quot;);
            if (arguments.link != &quot;URLs&quot;)
                loc.returnValue = REReplaceNoCase(loc.returnValue, loc.mailRegex, &quot;<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">a</span> <span style="color: #0000FF;">href</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;&quot;</span>mailto:\<span style="color: #FF0000;">1</span><span style="color: #009900;">&quot;&quot;</span><span style="color: #0000FF;">&gt;</span></span>\1<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">a</span><span style="color: #0000FF;">&gt;</span></span>&quot;, &quot;all&quot;);
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfscript</span><span style="color: #0000FF;">&gt;</span></span>
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span> loc.returnValue<span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>It makes the function declarations a little beefier, but the documentation is right there with the code. As you can see, we added <code>examples</code>, <code>categories</code>, and <code>functions</code> attributes to the <code>&lt;cffunction&gt;</code> declaration.</p>
<p>Writing a parser took a little over a week, but it was fairly simple with <abbr title="ColdFusion Markup Language">CFML</abbr>&#8217;s <code><a href="http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7dd9.html">GetMetaData()</a></code> function and some extra business rules.</p>
<p>Here&#8217;s a link to the <a href="http://cfwheels.org/docs/function/autolink"><code>autoLink()</code></a> documentation on CFWheels.org so you can see what the output looks like. Everything on that page is generated based on the code above.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/adobe' rel='tag' target='_self'>adobe</a>, <a class='technorati-link' href='http://technorati.com/tag/ccm' rel='tag' target='_self'>ccm</a>, <a class='technorati-link' href='http://technorati.com/tag/cfml' rel='tag' target='_self'>cfml</a>, <a class='technorati-link' href='http://technorati.com/tag/cfwheels' rel='tag' target='_self'>cfwheels</a>, <a class='technorati-link' href='http://technorati.com/tag/chris+peters' rel='tag' target='_self'>chris peters</a>, <a class='technorati-link' href='http://technorati.com/tag/clear+crystal+media' rel='tag' target='_self'>clear crystal media</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion' rel='tag' target='_self'>ColdFusion</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+on+wheels' rel='tag' target='_self'>coldfusion on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/polymorphism' rel='tag' target='_self'>polymorphism</a>, <a class='technorati-link' href='http://technorati.com/tag/railo' rel='tag' target='_self'>railo</a>, <a class='technorati-link' href='http://technorati.com/tag/web+development' rel='tag' target='_self'>web development</a></p>

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/8309nbKrM2I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/extra-cfc-attributes-documentation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/extra-cfc-attributes-documentation/</feedburner:origLink></item>
		<item>
		<title>Script-based controllers and models, tag-based views</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/ctzfYvxk1Q4/</link>
		<comments>http://www.clearcrystalmedia.com/pm/script-controllers-models-tag-views/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 19:41:48 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion on Wheels]]></category>
		<category><![CDATA[ccm]]></category>
		<category><![CDATA[cf]]></category>
		<category><![CDATA[cf9]]></category>
		<category><![CDATA[cfc]]></category>
		<category><![CDATA[cfml]]></category>
		<category><![CDATA[cfscript]]></category>
		<category><![CDATA[cfwheels]]></category>
		<category><![CDATA[chris peters]]></category>
		<category><![CDATA[clear crystal media]]></category>
		<category><![CDATA[coldfusion 9]]></category>
		<category><![CDATA[coldfusion on wheels]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=404</guid>
		<description><![CDATA[<p>I'm looking forward to playing around with <a href="http://www.adobe.com/products/coldfusion/">ColdFusion 9</a> when I get some more time here in a month or so. One of the areas that interests me in particular is the ability to write full <abbr title="ColdFusion Component">CFC</abbr>s in CFScript syntax.</p>
<p>Read on for what I feel is the perfect blend of <abbr title="ColdFusion Markup Language">CFML</abbr> features used in the different layers of the <a href="http://cfwheels.org/">ColdFusion on Wheels</a> framework:</p>
<ul>
	<li>Controllers in script syntax</li>
	<li>Models in script syntax</li>
	<li>Views in tag syntax</li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m looking forward to playing around with <a href="http://www.adobe.com/products/coldfusion/">ColdFusion 9</a> when I get some more time here in a month or so. One of the areas that interests me in particular is the ability to write full <abbr title="ColdFusion Component">CFC</abbr>s in CFScript syntax.</p>
<p>Think about this scenario in <a href="http://cfwheels.org/">ColdFusion on Wheels</a>:</p>
<ul>
<li>Controllers in script syntax</li>
<li>Models in script syntax</li>
<li>Views in tag syntax</li>
</ul>
<p>I like the idea of this, though I&#8217;ll admit that I haven&#8217;t tried it yet. The more data- and logic-heavy parts of the app can be script-driven, while the tag-based syntax can be used with <abbr title="Hypertext Markup Language">HTML</abbr>.</p>
<p>Imagine this scenario for a Wheels model class:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">component extends=&quot;Model&quot; {
&nbsp;
    /**
      @hint Initializes associations and validations
    */
    public function init() {
        // Associations
        hasMany(&quot;chirps&quot;);
        // Validations
        validatesPresenceOf(&quot;firstName,lastName,email,gender,urlId&quot;);
        validatesUniquenessOf(&quot;email,urlId&quot;);
        validatesLengthOf(properties=&quot;firstName,lastName&quot;, maximum=50);
    }
&nbsp;
}</pre></div></div>

<p>And this for a Wheels controller:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">component extends=&quot;Controller&quot; {
&nbsp;
    /**
      @hint Shows form for registering for social network.
    */
    public function register() {
        user = model(&quot;user&quot;).new();
    }
&nbsp;
    /**
      @hint Saves registration submission.
    */
    public function create() {
        user = model(&quot;user&quot;).new(params.user);
        user.save();
&nbsp;
        if(user.hasErrors()) {
            renderPage(action=&quot;register&quot;);
        }
        else {
            flashInsert(success=&quot;Thank you for registering for Social Network.&quot;);
            redirectTo(controller=&quot;home&quot;);
        }
    }
&nbsp;
}</pre></div></div>

<p>And then any view logic can be mixed in via tags with all the other <abbr title="Hypertext Markup Language">HTML</abbr> tags (right where it belongs).</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfsetting</span> enablecfoutputonly<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;true&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;user&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">h1</span><span style="color: #0000FF;">&gt;</span></span>Register for Social Network<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">h1</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
#startFormTag(action=&quot;create&quot;)#
&nbsp;
#textField(label=&quot;First Name&quot;, objectName=&quot;user&quot;, property=&quot;firstName&quot;)#
#textField(label=&quot;Last Name&quot;, objectName=&quot;user&quot;, property=&quot;lastName&quot;)#
#textField(label=&quot;Email&quot;, objectName=&quot;user&quot;, property=&quot;email&quot;)#
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">fieldset</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">legend</span><span style="color: #0000FF;">&gt;</span></span>Gender<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">legend</span><span style="color: #0000FF;">&gt;</span></span>
    #radioButton(label=&quot;Male&quot;, objectName=&quot;user&quot;, property=&quot;gender&quot;, tagValue=&quot;M&quot;)#
    #radioButton(label=&quot;Female&quot;, objectName=&quot;user&quot;, property=&quot;gender&quot;, tagValue=&quot;F&quot;)#
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">fieldset</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">fieldset</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">legend</span><span style="color: #0000FF;">&gt;</span></span>Profile Address<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">legend</span><span style="color: #0000FF;">&gt;</span></span>
    #textField(label=&quot;http://<span style="color: #0000FF;">#cgi.script_name#</span>/profile/&quot;, objectName=&quot;user&quot;, property=&quot;urlId&quot;)#
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">fieldset</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
    #submitTag(value=&quot;Register Now&quot;)#
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #0000FF;">#endFormTag<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span>#</span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfsetting</span> enablecfoutputonly<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>This makes me excited for Railo adoption of script-based <abbr title="ColdFusion Component">CFC</abbr>s and for time to warp 5 years into the future when script-based <abbr title="ColdFusion Component">CFC</abbr>s are more widely used in general.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/ccm' rel='tag' target='_self'>ccm</a>, <a class='technorati-link' href='http://technorati.com/tag/cf' rel='tag' target='_self'>cf</a>, <a class='technorati-link' href='http://technorati.com/tag/cf9' rel='tag' target='_self'>cf9</a>, <a class='technorati-link' href='http://technorati.com/tag/cfc' rel='tag' target='_self'>cfc</a>, <a class='technorati-link' href='http://technorati.com/tag/cfml' rel='tag' target='_self'>cfml</a>, <a class='technorati-link' href='http://technorati.com/tag/cfscript' rel='tag' target='_self'>cfscript</a>, <a class='technorati-link' href='http://technorati.com/tag/cfwheels' rel='tag' target='_self'>cfwheels</a>, <a class='technorati-link' href='http://technorati.com/tag/chris+peters' rel='tag' target='_self'>chris peters</a>, <a class='technorati-link' href='http://technorati.com/tag/clear+crystal+media' rel='tag' target='_self'>clear crystal media</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion' rel='tag' target='_self'>ColdFusion</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+9' rel='tag' target='_self'>coldfusion 9</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+on+wheels' rel='tag' target='_self'>coldfusion on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/mvc' rel='tag' target='_self'>mvc</a>, <a class='technorati-link' href='http://technorati.com/tag/polymorphism' rel='tag' target='_self'>polymorphism</a>, <a class='technorati-link' href='http://technorati.com/tag/railo' rel='tag' target='_self'>railo</a></p>

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/ctzfYvxk1Q4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/script-controllers-models-tag-views/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/script-controllers-models-tag-views/</feedburner:origLink></item>
	</channel>
</rss>
