<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - wtg - public - coding_standards - goodpractice.html</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-24T22:31:33</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#19710" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#19632" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#17396" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#15763" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#19710">
		<title>wtg/public/coding_standards/goodpractice.html</title>
		<link>http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#19710</link>
		<description>Extending global.cfc is not good practice - CFC A should only extend CFC B if the logical relationship &quot;A is-a B&quot; holds true. Since global.cfc does not represent any sort of logical entity, the &quot;is-a&quot; relationship cannot hold.&lt;br /&gt;&lt;br /&gt;You have several options for global variables depending on whether they represent truly static values (use a configuration file of some sort - either XML or a 'properties' file since CF can read both of those easily) or dynamic values.&lt;br /&gt;&lt;br /&gt;For dynamic values, you can still use a CFC but it is just a 'service' CFC with methods to get the desired global value. Code that uses that CFC can either simply cfinvoke the method or, if you wish, construct an instance of the CFC and call multiple methods.</description>
		<dc:creator>SeanCorfield</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-08-06T18:54:00</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#19632">
		<title>wtg/public/coding_standards/goodpractice.html</title>
		<link>http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#19632</link>
		<description>May I know what is the best way to define global variables in CFCs?&lt;br /&gt;&lt;br /&gt;Currently I have a global.cfc for each project to hold the global variables, and other CFCs will extend global.cfc if they need the variables. Your article recommends every contructor to have a init(). Does it imply for my global.cfc as well, since it doesn't contains any function, only variables.&lt;br /&gt;&lt;br /&gt;My CFCs are Web services, and they don't store at the same place with other CFMs, so I suppose storing global variables in Application.cfm is not a good choice.&lt;br /&gt;&lt;br /&gt;I'm having quite a number of projects on the server, so I suppose  declaring global variables for each project in component.cfc is not very suitable also, since different projects use different sets of variables.</description>
		<dc:creator>yitian</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-08-04T19:16:48</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#17396">
		<title>wtg/public/coding_standards/goodpractice.html</title>
		<link>http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#17396</link>
		<description>In a language that silently converts numeric values to boolean when the context requires it, you have the situation that zero converts to false but any non-zero value converts to true. However, while false converts to zero for a numeric comparison (allowing you to test eq false), true converts to 1 which will not be equal to an arbitrary numeric value.&lt;br&gt;&lt;br&gt;That becomes a trap when you see things like if ( compare(s1,s2) ) and think you can do if ( compare(s1,s2) eq true ) - which only yields true when s1 is greater than s2 even tho' the first form yields true for s1 less than or greater than s2.&lt;br&gt;&lt;br&gt;Therefore it is simply much safer to never test values equal to true or false and let the implied boolean context 'do the right thing'.</description>
		<dc:creator>SeanCorfield</dc:creator>
		<dc:type>1 1</dc:type>
		<dc:date>2004-06-21T17:22:55</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#15763">
		<title>wtg/public/coding_standards/goodpractice.html</title>
		<link>http://livedocs.adobe.com/wtg/public/coding_standards/goodpractice.html#15763</link>
		<description>this first point about booleans - why is it bad practict to provide the expected value - i realise that it's redundant, but is there any danger is doing so?</description>
		<dc:creator>grantmr</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-05-30T17:34:38</dc:date>
	</item>
	</rdf:RDF>

