<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Technoclasm &#187; implicit</title>
	<atom:link href="http://www.technoclasm.com/tag/implicit/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.technoclasm.com</link>
	<description>A few thoughts about Coldfusion, Development and Life</description>
	<lastBuildDate>Thu, 20 May 2010 14:49:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>implicit getters and setters using CF</title>
		<link>http://www.technoclasm.com/2009/12/implicit-getters-and-setters-using-cf/</link>
		<comments>http://www.technoclasm.com/2009/12/implicit-getters-and-setters-using-cf/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 10:19:54 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[auto-magic]]></category>
		<category><![CDATA[getters]]></category>
		<category><![CDATA[implicit]]></category>
		<category><![CDATA[setters]]></category>

		<guid isPermaLink="false">http://www.technoclasm.com/?p=105</guid>
		<description><![CDATA[A few notes on implicit vs explicit getters and setters.
1) Coldfusion support in CF9 is enabled on the property tag as an attribute &#8211; not on by default
http://www.danvega.org/blog/index.cfm/2009/10/6/ColdFusion-9-Implicit-getters&#8211;setters-change
2) Coldfusion onMissingMethod
http://www.bennadel.com/index.cfm?dax=blog:868.view 
Although Ben Nadel seems to dislike the thing ( it was a while back so maybe he changed his mind?) &#8211; and he&#8217;s being convinced [...]]]></description>
			<content:encoded><![CDATA[<p>A few notes on implicit vs explicit getters and setters.</p>
<p>1) Coldfusion support in CF9 is enabled on the property tag as an attribute &#8211; not on by default<br />
<a href="http://www.danvega.org/blog/index.cfm/2009/10/6/ColdFusion-9-Implicit-getters--setters-change">http://www.danvega.org/blog/index.cfm/2009/10/6/ColdFusion-9-Implicit-getters&#8211;setters-change</a></p>
<p>2) Coldfusion onMissingMethod<br />
<a href="http://www.bennadel.com/index.cfm?dax=blog:868.view ">http://www.bennadel.com/index.cfm?dax=blog:868.view </a><br />
Although Ben Nadel seems to dislike the thing ( it was a while back so maybe he changed his mind?) &#8211; and he&#8217;s being convinced in the comments. The performance affect was exceedingly marginal (&lt;20ms).</p>
<p>An implementation of what I was talking about is here:<br />
<a href="http://www.coldfusionjedi.com/index.cfm/2007/8/5/Warning-about-onMissingMethod">http://www.coldfusionjedi.com/index.cfm/2007/8/5/Warning-about-onMissingMethod</a> &#8211; the warning relates to using the right arguments. Comments suggested changing find to comparing the first 3 characters to improve performance.<br />
<code><br />
&lt;cfcomponent name="entity_auto" extends="ColdFX.entity" output="false"&gt;</code></p>
<p>&lt;cffunction name=&#8221;onMissingMethod&#8221; access=&#8221;public&#8221; returnType=&#8221;any&#8221; output=&#8221;false&#8221;&gt;<br />
&lt;cfargument name=&#8221;missingMethodName&#8221; type=&#8221;string&#8221; required=&#8221;true&#8221;&gt;<br />
&lt;cfargument name=&#8221;missingMethodArguments&#8221; type=&#8221;struct&#8221; required=&#8221;true&#8221;&gt;<br />
&lt;cfset var key = &#8220;&#8221;&gt;</p>
<p>&lt;!&#8212; this includes arguments with set &#8212;&gt;<br />
&lt;cfif left(arguments.missingMethodName,3) eq &#8220;set&#8221;&gt;<br />
&lt;cfset key = replaceNoCase(arguments.missingMethodName,&#8221;get&#8221;,&#8221;")&gt;<br />
&lt;cfif structKeyExists(variables, key)&gt;<br />
&lt;cfreturn variables[key]&gt;<br />
&lt;/cfif&gt;<br />
&lt;/cfif&gt;</p>
<p>&lt;!&#8212; this includes arguments with get &#8212;&gt;<br />
&lt;cfif left(arguments.missingMethodName,3) eq &#8220;get&#8221;&gt;<br />
&lt;cfset key = replaceNoCase(arguments.missingMethodName,&#8221;set&#8221;,&#8221;")&gt;<br />
&lt;cfif structKeyExists(arguments.missingMethodArguments, key)&gt;<br />
&lt;cfset variables[key] = arguments.missingMethodArguments[key]&gt;<br />
&lt;/cfif&gt;<br />
&lt;/cfif&gt;</p>
<p>&lt;!&#8212; everything else still throws an error &#8212;&gt;</p>
<p>&lt;/cffunction&gt;</p>
<p>&lt;/cfcomponent&gt;</p>
<p>If you want to turn on auto magic dynamic proxying all you do in your component is<br />
<code><br />
&lt;cfcomponent name="car" extends="ColdFX.entity_auto" output="false"&gt;<br />
&lt;cfproperty name="wheels"&gt;<br />
&lt;cfproperty name="engine"&gt;</code></p>
<p>&lt;cffunction name=&#8221;init&#8221;&gt;<br />
&lt;cfargument name=&#8221;wheels&#8221;&gt;<br />
&lt;cfargument name=&#8221;engine&#8221;&gt;<br />
&lt;cfset this.setWheels(arguments.wheels)/&gt;<br />
&lt;cfset this.setEngine(arguments.engine)/&gt;<br />
&lt;/cffunction&gt;</p>
<p>&lt;/cfcomponent&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.technoclasm.com/2009/12/implicit-getters-and-setters-using-cf/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
