<?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: Performance loss in CFCs is not as significant as I once thought</title>
	<atom:link href="http://www.chrispetersweb.com/2005/11/25/performance-loss-in-cfcs-is-not-as-significant-as-i-once-thought/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrispetersweb.com/2005/11/25/performance-loss-in-cfcs-is-not-as-significant-as-i-once-thought/</link>
	<description></description>
	<pubDate>Mon, 01 Dec 2008 21:49:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Chris Peters</title>
		<link>http://www.chrispetersweb.com/2005/11/25/performance-loss-in-cfcs-is-not-as-significant-as-i-once-thought/#comment-23</link>
		<dc:creator>Chris Peters</dc:creator>
		<pubDate>Mon, 28 Nov 2005 13:10:34 +0000</pubDate>
		<guid isPermaLink="false">http://208.112.67.4/blog/accessibility/performance-loss-in-cfcs-is-not-as-significant-as-i-once-thought#comment-23</guid>
		<description>Lastly, I should mention that another advantage of using setters in beans is that you don't necessarily have to set every data member. This means that queries that feed into beans don't need to select every single piece of data if the calling page doesn't require it.</description>
		<content:encoded><![CDATA[<p>Lastly, I should mention that another advantage of using setters in beans is that you don&#8217;t necessarily have to set every data member. This means that queries that feed into beans don&#8217;t need to select every single piece of data if the calling page doesn&#8217;t require it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Peters</title>
		<link>http://www.chrispetersweb.com/2005/11/25/performance-loss-in-cfcs-is-not-as-significant-as-i-once-thought/#comment-22</link>
		<dc:creator>Chris Peters</dc:creator>
		<pubDate>Sun, 27 Nov 2005 20:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://208.112.67.4/blog/accessibility/performance-loss-in-cfcs-is-not-as-significant-as-i-once-thought#comment-22</guid>
		<description>I finally figured out that the reason why my bean changes would not get passed back correctly in an array was a result of the behavior of the ArrayAppend() function.

As it turns out, ArrayAppend() passes CFC instances by reference. That means if you add an instance to an array and change the instance's value outside of the array, the instance's state is affected inside of the array as well.

Generally, ColdFusion passes by value, so this is pretty inconsistent and pretty confusing. Looks like calling CreateObject() in each loop iteration is necessary after all.

Back to the debugging drawing board...

Thanks to these sites for help:

Creating and Accessing Collection Files
ColdFusion Developer's Journal
http://cfdj.sys-con.com/read/41549.htm

Arrays are passed by value, no by reference, no by value
Compound Theory
http://www.compoundtheory.com/?action=displayPost&#38;ID=65</description>
		<content:encoded><![CDATA[<p>I finally figured out that the reason why my bean changes would not get passed back correctly in an array was a result of the behavior of the ArrayAppend() function.</p>
<p>As it turns out, ArrayAppend() passes CFC instances by reference. That means if you add an instance to an array and change the instance&#8217;s value outside of the array, the instance&#8217;s state is affected inside of the array as well.</p>
<p>Generally, ColdFusion passes by value, so this is pretty inconsistent and pretty confusing. Looks like calling CreateObject() in each loop iteration is necessary after all.</p>
<p>Back to the debugging drawing board&#8230;</p>
<p>Thanks to these sites for help:</p>
<p>Creating and Accessing Collection Files<br />
ColdFusion Developer&#8217;s Journal<br />
<a href="http://cfdj.sys-con.com/read/41549.htm" rel="nofollow">http://cfdj.sys-con.com/read/41549.htm</a></p>
<p>Arrays are passed by value, no by reference, no by value<br />
Compound Theory<br />
<a href="http://www.compoundtheory.com/?action=displayPost&amp;ID=65" rel="nofollow">http://www.compoundtheory.com/?action=displayPost&amp;ID=65</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Peters</title>
		<link>http://www.chrispetersweb.com/2005/11/25/performance-loss-in-cfcs-is-not-as-significant-as-i-once-thought/#comment-21</link>
		<dc:creator>Chris Peters</dc:creator>
		<pubDate>Sun, 27 Nov 2005 02:17:48 +0000</pubDate>
		<guid isPermaLink="false">http://208.112.67.4/blog/accessibility/performance-loss-in-cfcs-is-not-as-significant-as-i-once-thought#comment-21</guid>
		<description>Ok, so the plot thickens. I redid a few CFCs using setters and getters. Within each loop iteration, I didn't reinstantiate the CFC I was adding to an array. But the setter values aren't holding once the CFC instance is appended to the array. For example, this code doesn't work:

&lt;cfloop query="qGetTeams"&gt;
   &lt;cfset team.setID(qGetTeams.id) /&gt;
   &lt;cfset team.setName(qGetTeams.name) /&gt;
   &lt;cfset ArrayAppend(teams, team) /&gt;
&lt;/cfloop&gt;</description>
		<content:encoded><![CDATA[<p>Ok, so the plot thickens. I redid a few CFCs using setters and getters. Within each loop iteration, I didn&#8217;t reinstantiate the CFC I was adding to an array. But the setter values aren&#8217;t holding once the CFC instance is appended to the array. For example, this code doesn&#8217;t work:</p>
<p><cfloop query="qGetTeams"><br />
   <cfset team.setID(qGetTeams.id) /><br />
   <cfset team.setName(qGetTeams.name) /><br />
   <cfset ArrayAppend(teams, team) /><br />
</cfloop></p>
]]></content:encoded>
	</item>
</channel>
</rss>
