<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
			<channel>
            <atom:link href="http://blog.classsoftware.com/rss.cfm?mode=full" rel="self" type="application/rss+xml" />
			<title>Class Software - Design Patterns</title>
			<link>http://blog.classsoftware.com/index.cfm</link>
			<description>Web technologies and applications focusing on ColdFusion, Flex and Flash.</description>
			<image>
    			<title>Class Software</title>
    			<url>http://www.classsoftware.com/images/logosm.gif</url>
    			<link>http://blog.classsoftware.com/index.cfm</link>
			</image>			
			<language>en-us</language>
			<pubDate>Fri, 10 Sep 2010 00:09:15 +1000</pubDate>
			<lastBuildDate>Tue, 10 Apr 2007 18:32:00 +1000</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>justin@classsoftware.com (Justin Mclean)</managingEditor>
			<webMaster>justin@classsoftware.com (Justin Mclean)</webMaster>
				
			
			
			
			
			<item>
				<title>ColdFusion Singletons Revisited</title>
				<link>http://blog.classsoftware.com/index.cfm/2007/4/10/ColdFusion-Singletons-Revisited</link>
				<description>
				
				My last &lt;a href=&quot;http://blog.classsoftware.com/index.cfm/2007/4/9/ColdFusion-Singletons&quot;&gt;article&lt;/a&gt; on singletons got a few comments on blogs and in email including how it could be improved (thanks Michael) and a few questions. I also omitted the code showing how the singletons were created and called (now added).

So here&apos;s the new improved code!
				 [More]
				</description>
						
				
				<category>ColdFusion</category>				
				
				<category>Dynamic Methods</category>				
				
				<category>Design Patterns</category>				
				
				<category>Singleton</category>				
				
				<pubDate>Tue, 10 Apr 2007 18:32:00 +1000</pubDate>
				<guid>http://blog.classsoftware.com/index.cfm/2007/4/10/ColdFusion-Singletons-Revisited</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion Singletons</title>
				<link>http://blog.classsoftware.com/index.cfm/2007/4/9/ColdFusion-Singletons</link>
				<description>
				
				Singletons are perhaps one of the most simple Design Patterns. For those who don&apos;t know sigletons are a class that can only have one instance. They can be thought of as a glorified global variable - but are a lot more useful.

Most ColdFusion classes, or rather instances of CF components, can be turned in a singleton by placing the following code in your Application.cfm:
&lt;code&gt;
	&lt;cfif not structkeyexists(application,&lt;instance name&gt;)&gt;
		&lt;cfset application.&lt;instance name&gt; = createobject(&quot;component&quot;,&lt;path to component&gt;)&gt;
	&lt;/cfif&gt;
&lt;/code&gt;

or OnApplicationStart method of your Application.cfc:
&lt;code&gt;
	&lt;cfset application.&lt;instance name&gt; = createobject(&quot;component&quot;,&lt;path to component&gt;)&gt;
&lt;/code&gt;
				 [More]
				</description>
						
				
				<category>ColdFusion</category>				
				
				<category>Design Patterns</category>				
				
				<category>Singleton</category>				
				
				<pubDate>Mon, 09 Apr 2007 23:30:00 +1000</pubDate>
				<guid>http://blog.classsoftware.com/index.cfm/2007/4/9/ColdFusion-Singletons</guid>
				
			</item>
			
		 	
			</channel></rss>