<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Vince Bonfanti&apos;s Weblog - CFML</title>
			<link>http://blog.newatlanta.com/index.cfm</link>
			<description></description>
			<language>en-us</language>
			<pubDate>Wed, 22 May 2013 19:07:13 -0400</pubDate>
			<lastBuildDate>Fri, 10 Jul 2009 06:30:00 -0400</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>vbonfanti@newatlanta.com</managingEditor>
			<webMaster>vbonfanti@newatlanta.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>vbonfanti@newatlanta.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>Vince Bonfanti&apos;s Weblog</title>
				<link>http://blog.newatlanta.com/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>Thoughts on CFML tags, CFSCRIPT, Custom Tags and CFML2009</title>
				<link>http://blog.newatlanta.com/index.cfm/2009/7/10/Thoughts-on-CFML-tags-CFSCRIPT-Custom-Tags-and-the-CFML2009-specification</link>
				<description>
				
				I&apos;ve been following with some interest the work of the CFML Advisory Committee on the CFML2009 specification, particularly the proposed enhancements to CFSCRIPT. The question of being able to call Custom Tags from CFSCRIPT has helped crystalize thoughts I&apos;ve been forming for some time regarding the relationship between CFML tags and CFSCRIPT, and how to write better CFML applications.

The thing that makes CFML great is its tag-based syntax when used to generate dynamic HTML content. CFML is simply unmatched by any other web application development language in this regard. In fact, you could argue that JSP tag libraries (including the JSP Standard Tag Library) and ASP.NET server controls are nothing more than attempts to mimic CFML tag-based syntax.

However, CFML tag-based syntax is awkward and verbose when writing lengthy computational or business logic that isn&apos;t generating HTML output. CFML suffers in comparison to other programming languages in this regard. But, this is where CFSCRIPT shines. It&apos;s unfortunate that many (most?) people only know about CFML&apos;s tag-based syntax and are completely unaware of CFSCRIPT; and, that CFSCRIPT has often been treated as secondary to the tag-based syntax by both CFML developers and CFML server vendors. Conversely, while CFSCRIPT is good for computational or business logic, you would not want to use CFSCRIPT and the &lt;tt&gt;writeOutput()&lt;/tt&gt; function to generate large amounts of HTML content.

In summary:
&lt;blockquote&gt;
&lt;b&gt;CFML tags.&lt;/b&gt; Good (great!) for generating dynamic HTML content. Bad for writing computational or business logic.
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;b&gt;CFSCRIPT.&lt;/b&gt; Good for writing computational or business logic. Bad for generating dynamic HTML content.
&lt;/blockquote&gt;
If you accept this view, then the answer to the question of calling Custom Tags from CFSCRIPT is simple: don&apos;t do it. Custom Tags are an extension mechanism for CFML tag-based syntax. Custom Tags are intended to generate dynamic HTML content, not to contain computational or business logic. CFSCRIPT should be used for computational or business logic, not to generate HTML content. Calling Custom Tags from CFSCRIPT makes no sense.

Following on these thoughts, user-defined functions and components are extension mechanisms for adding computational or business logic to CFML, not for generating HTML content. In retrospect--and I&apos;m not being critical here--the CFFUNCTION and CFCOMPONENT tags were probably a mistake. It might have been better for the CFML language and CFML developers if these features had originally been introduced and/or remained CFSCRIPT-only enhancements.

I welcome the proposed enhancements to CFSCRIPT, and have these suggestions for the CFML Advisory Committee and CFML developers:
&lt;ul&gt;
&lt;li&gt;Don&apos;t add support for calling Custom Tags from CFSCRIPT to the CFML2009 specification. If it is added, CFML developers shouldn&apos;t use it.&lt;/li&gt;
&lt;p&gt;&lt;li&gt;As soon as your favorite CFML server supports CFML2009 and the CFSCRIPT enhancements, ban the use of the CFFUNCTION and CFCOMPONENT tags. Require that user-defined functions and components be implemented using CFSCRIPT.&lt;/li&gt;
&lt;p&gt;&lt;li&gt;Immediately ban the use of the &lt;tt&gt;writeOutput()&lt;/tt&gt; function and require that all HTML content be generated using tag-base syntax.&lt;/li&gt;
&lt;/ul&gt;
Following these suggestions will take maximum advantage of the respective benefits of CFML tags and CFSCRIPT, and encourage separatation of presentation layer (CFML tags) and business layer (CFSCRIPT) logic within your applications. The result will be better organized CFML applications that are easier to enhance and maintain.
				
				</description>
						
				
				<category>CFML</category>				
				
				<pubDate>Fri, 10 Jul 2009 06:30:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm/2009/7/10/Thoughts-on-CFML-tags-CFSCRIPT-Custom-Tags-and-the-CFML2009-specification</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>IIS 7.0 Integrated Pipeline and BlueDragon/CFML</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=14695C4B-1283-DACA-A8D21134BB195D39</link>
				<description>
				
				The one feature I&apos;m most excited about in Windows Vista and Windows Server 2008 (&quot;Longhorn&quot;) is IIS 7.0, the next generation of Microsoft&apos;s IIS web server. Starting with this blog entry, I&apos;m going to highlight some of the new features of IIS 7.0 and what they mean for BlueDragon/CFML programmers. To get a good overview of IIS 7.0, you should start by reading the article by Mike Volodarsky in the March 2007 issue of MSDN magazine, entitled, &quot;&lt;a href=&apos;http://msdn.microsoft.com/msdnmag/issues/07/03/IIS7/default.aspx&apos; target=&apos;_blank&apos;&gt;IIS 7.0: Explore the Web Server for Windows Vista And Beyond&lt;/a&gt;.&quot; There&apos;s also an entire web site devoted to IIS, including &lt;a href=&apos;http://www.iis.net/default.aspx?tabid=7&apos; target=&apos;_blank&apos;&gt;extensive information about IIS 7.0&lt;/a&gt;, that&apos;s well worth checking out.

The first new IIS 7.0 feature I want to focus on in this blog entry is the &lt;a href=&apos;http://www.iis.net/articles/view.aspx/IIS7/Hosting-Web-Applications/ASP-NET/ASP-NET-Integration-with-IIS7&apos; target=&apos;_blank&apos;&gt;ASP.NET Integrated Request Pipeline&lt;/a&gt;. As a CFML programmer, you&apos;re already familiar with the concept of a &quot;request pipeline&quot; as implemented by the &lt;tt&gt;onRequestStart&lt;/tt&gt;, &lt;tt&gt;onRequest&lt;/tt&gt;, and &lt;tt&gt;onRequestEnd&lt;/tt&gt; event handlers within &lt;tt&gt;Application.cfc&lt;/tt&gt;. Both IIS and ASP.NET implement similar mechanisms for programmers to access their request pipelines; however, prior to IIS 7.0, the IIS and ASP.NET request pipelines are separate and independent of each other. Further, the &lt;tt&gt;Application.cfc&lt;/tt&gt; events are independent of both of these; the &lt;tt&gt;Application.cfc&lt;/tt&gt; event handlers are only invoked for requests for CFML pages and CFCs.

In IIS 7.0, the IIS and ASP.NET request pipelines have been integrated into a single unified runtime. This means that it&apos;s now possible for ASP.NET programmers to hook into the full IIS 7.0 request pipeline for all requests: static file, images, and any dynamic content (classic ASP, PHP, etc.) in addition to ASP.NET requests. Here&apos;s where it gets exciting for BlueDragon/CFML programmers: because BlueDragon.NET is tightly integrated with ASP.NET, we&apos;re able to expose the IIS 7.0 integrated pipeline via existing and new &lt;tt&gt;Application.cfc&lt;/tt&gt; event handlers.

With IIS 7.0 and BlueDragon.NET, you&apos;ll be able to configure your &lt;tt&gt;Application.cfc&lt;/tt&gt; event handlers to be invoked for any or all requests handled by IIS: static files, images, ASP.NET pages, and any other dynamic content (classic ASP, PHP, etc.). Here&apos;s a simplified example that hints as what will be possible. The following &lt;tt&gt;onRequestStart&lt;/tt&gt; event handler is configured to handle all incoming requests for IIS and does two things: (1) it prevents external sites from linking to GIF or JPEG images on this site, returning a &quot;404 Not Found&quot; response instead; and, (2) it prevents external sites from linking anywhere except to the home page (&quot;index.cfm&quot;) for this site.
&lt;pre&gt;   &amp;lt;cffunction name=&quot;onRequestStart&quot; returnType=&quot;boolean&quot; output=&quot;false&quot;&amp;gt;
      &amp;lt;cfargument name=&quot;thePage&quot; type=&quot;string&quot; required=&quot;true&quot;&amp;gt;
		
      &amp;lt;cfif findNoCase( cgi.SERVER_NAME, cgi.HTTP_REFERER ) gt 0&amp;gt;
         &amp;lt;!--- referrer is this server ---&amp;gt;
         &amp;lt;cfreturn true&amp;gt;
      &amp;lt;/cfif&amp;gt;
		
      &amp;lt;!--- referrer is not this server, don&apos;t allow image &quot;leeching&quot;
            or &quot;deep&quot; links ---&amp;gt;
		
      &amp;lt;cfset var fileExt = right( arguments.thePage, 3 )&amp;gt;
		
      &amp;lt;cfif ( fileExt eq &quot;gif&quot; ) or ( fileExt eq &quot;jpg&quot; )&amp;gt;
         &amp;lt;!--- don&apos;t allow image &quot;leeching&quot; ---&amp;gt;	
         &amp;lt;cfheader statuscode=&quot;404&quot; statustext=&quot;Not Found&quot;&amp;gt;
         &amp;lt;cfreturn false&gt;
      &amp;lt;/cfif&gt;
		
      &amp;lt;cfif ( arguments.thePage neq &quot;/index.cfm&quot; ) and
               ( arguments.thePage neq &quot;/sorry.htm&quot; )&amp;gt;
         &amp;lt;!--- don&apos;t allow &quot;deep&quot; links ---&amp;gt;
         &amp;lt;cflocation url=&quot;/sorry.htm&quot;&amp;gt;
         &amp;lt;cfreturn false&amp;gt;
      &amp;lt;/cfif&amp;gt;
		
      &amp;lt;cfreturn true&amp;gt;
   &amp;lt;/cffunction&amp;gt;
&lt;/pre&gt;

I&apos;ll demonstrate the above &lt;tt&gt;Application.cfc&lt;/tt&gt; and discuss it in detail during my keynote at CFUNITED-07.

In addition to allowing the existing &lt;tt&gt;Application.cfc&lt;/tt&gt; &lt;tt&gt;onRequestStart&lt;/tt&gt; and &lt;tt&gt;onRequestEnd&lt;/tt&gt; event handlers to be invoked for any request handled by IIS, we&apos;re adding the following new &lt;tt&gt;Application.cfc&lt;/tt&gt; event handlers to BlueDragon.NET:&lt;ul&gt;&lt;li&gt;onRequestAuthenticate
&lt;li&gt;onRequestAuthorize
&lt;li&gt;onRequestLog&lt;/ul&gt;The events map directly to the &lt;tt&gt;AuthenticateRequest&lt;/tt&gt;, &lt;tt&gt;AuthorizeRequest&lt;/tt&gt;, and &lt;tt&gt;LogRequest&lt;/tt&gt; events in the IIS 7.0 integrated pipeline (they are the same events!), and will be invoked for every request processed by IIS. You can imagine being able to use CFLOGIN to implement an authentication scheme that works for all content on your site, not just CFML pages, or being able to implement custom logging for all types of pages.

Our overriding vision is to make CFML a first-class programming language on .NET and Windows--you should be able to do anything in CFML that a C# or Visual Basic programmer can do. Giving CFML programmers access to the IIS 7.0 integrated pipeline is only the first step--I&apos;ll talk more about our vision and plans in future blog entries and at CFUNITED-07.
				
				</description>
						
				
				<category>BlueDragon.NET</category>				
				
				<category>CFUNITED</category>				
				
				<category>CFML</category>				
				
				<pubDate>Mon, 18 Jun 2007 17:52:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=14695C4B-1283-DACA-A8D21134BB195D39</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>.NET Dynamic Language Runtime (DLR) and BlueDragon/CFML</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=AB37DAFC-8A49-113A-11696DE66062FA8B</link>
				<description>
				
				Earlier this week I was at Microsoft working with the developers of the .NET &lt;a href=&apos;http://blogs.msdn.com/hugunin/archive/2007/04/30/a-dynamic-language-runtime-dlr.aspx&apos; target=&apos;_blank&apos;&gt;Dynamic Language Runtime&lt;/a&gt; (DLR) and would like to share what I&apos;ve learned, what we accomplished, and the potential future impact on BlueDragon and CFML.

&lt;a href=&apos;http://weblogs.asp.net/scottgu/&apos; target=&apos;_blank&apos;&gt;Scott Guthrie&lt;/a&gt; started with an overview of Microsoft&apos;s strategy for developer tools and technologies, and an explanation of how the DLR fits into this strategy. He identified three major areas of software application development:&lt;ul&gt;&lt;li&gt;desktop applications (console and GUI-based)
&lt;li&gt;HTML-based web applications
&lt;li&gt;media-based rich Internet applications (RIA)
&lt;/ul&gt;Microsoft&apos;s goal is to provide a common set of technologies and developer/designer tools for building applications in all of these three areas. The common technologies are:&lt;ul&gt;&lt;li&gt;the .NET Framework
&lt;li&gt;Windows Presentation Foundation (WPF)
&lt;li&gt;&lt;a href=&apos;http://silverlight.net/Default.aspx&apos; target=&apos;_blank&apos;&gt;Silverlight&lt;/a&gt; (formerly WPF/e)
&lt;/ul&gt;The common developer/designer tools are:&lt;ul&gt;&lt;li&gt;Visual Studio (for developers)
&lt;li&gt;Expression Studio (for designers)
&lt;/ul&gt;Contrast this to the situation that existed prior to the introduction of these technologies and tools. Building Windows desktop applications required using C/C++ and programming to the Win32 APIs. Building HTML-based web applications required use of either ASP, JSP, PHP, or CFML, along with JavaScript. Building RIA applications essentially meant using Flash and ActionScript. Each of these technologies comes with its own set of programming tools, and there&apos;s little or no integration among any of the developer tools and tools used by designers.

It&apos;s the ability to use a common set of technologies and tools to target a variety of application domains that makes Microsoft&apos;s strategy so appealing. The goal of the DLR effort is to make sure dynamic languages--such as Python, Ruby, JavaScript, etc.--can participate as first class citizens alongside static languages--such as C#, Visual Basic.NET, etc.--in this overall strategy. Our goal at New Atlanta is to make sure that CFML is one of those dynamic languages.

So what did we accomplish in three days? First, we modified the IronPython interactive command-line shell to support a small subset of CFML--just the CFSET and CFOUTPUT tags so far. Here&apos;s some sample output (the &quot;&gt;&gt;&gt;&quot; characters are the command-line prompt):

&lt;center&gt;&lt;img src=&apos;http://blog.newatlanta.com/images/IronDragon_console.jpg&apos; border=&apos;0&apos;&gt;&lt;/center&gt;


This may not look very exciting, but let me explain what&apos;s going on here. This isn&apos;t a toy example; the CFML parsing is being done by the BlueDragon.NET parser--the very same one in the currently shipping BlueDragon.NET 7.0 product. And, the CFML is not being interpreted--every line is being compiled on-the-fly (dynamically) by the DLR into .NET Intermediate Language (IL) byte code and executed by the .NET runtime.

What we&apos;re demonstrating here is the ability to hook up the BlueDragon.NET CFML parsing front-end with the DLR code generation back-end to produce a much tighter integration between CFML and the .NET runtime than what&apos;s currently provided by BlueDragon.NET. We&apos;re not very many steps away from being able to create a Windows console application that looks like this:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent name=&quot;Hello&quot;&gt;
    &amp;lt;cffunction name=&quot;Main&quot;&gt;
        &amp;lt;cfset text=&quot;Hello, world!&quot;&gt;
        &amp;lt;cfoutput&gt;#text#&amp;lt;/cfoutput&gt;
    &amp;lt;/cffunction&gt;
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

The idea is that you&apos;ll be able to compile the above code into a Windows executable (&quot;Hello.exe&quot;) and run it. The result would be exactly equivalent to the following C# code:

&lt;blockquote&gt;&lt;pre&gt;using System;


class Hello
{
    static void Main() {
        string text = &quot;Hello, world!&quot;;
        Console.WriteLine( text );
    }
}
&lt;/pre&gt;&lt;/blockquote&gt;

Add to this the ability to create and invoke .NET objects via CreateObject/CFOBJECT, and you can easily imagine how it&apos;ll be possible to create desktop applications in CFML using .NET-based Windows Forms (WinForms). You&apos;ll also be able to use CFML to create ASP.NET web applications, and be able to run CFML within Silverlight. Again, this is the goal of Microsoft&apos;s strategy: to be able to use the same programming languages, tools, and technologies to create any type of application.

What about tools support? By integrating CFML with the DLR, we were also able to demonstrate step debugging within Visual Studio. Here&apos;s a screenshot of setting a breakpoint on a CFSET tag:

&lt;center&gt;&lt;img src=&apos;http://blog.newatlanta.com/images/IronDragon_debugging.jpg&apos; border=&apos;0&apos;&gt;&lt;/center&gt;

Not bad for three days work! (OK, we cheated--the step debugging was finished on the plane ride home yesterday).

We&apos;re very excited by the possibilites and promise of a DLR-based implementation of BlueDragon (which, you may notice from the screenshots, we&apos;re calling &quot;IronDragon&quot;). CFML will no longer be just about creating HTML-based web applications--though it&apos;ll still be great for that, of course--and will be supported as a first-class citizen by Microsoft development tools.

Among other topics, I&apos;m going to talk more about IronDragon and provide additional demonstrations during my keynote presentation at &lt;a href=&apos;http://cfunited.com/&apos; target=&apos;_blank&apos;&gt;CFUNITED-07&lt;/a&gt;. I&apos;m also going to be available at our booth to talk about this in more detail, so please stop by and see me if you&apos;re interested in learning more.
				
				</description>
						
				
				<category>BlueDragon.NET</category>				
				
				<category>CFUNITED</category>				
				
				<category>CFML</category>				
				
				<pubDate>Fri, 25 May 2007 15:45:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=AB37DAFC-8A49-113A-11696DE66062FA8B</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>.NET Dynamic Language Runtime (DLR) on Linux/Mono</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=78128D4A-12E4-8122-F214137D36667333</link>
				<description>
				
				It looks like the Mono developers already have the &lt;a href=&apos;http://www.oreillynet.com/xml/blog/2007/05/monodlr_hello_dynamic_language.html&apos; target=&apos;_blank&apos;&gt;.NET Dynamic Language Runtime (DLR) and IronPython working on Linux&lt;/a&gt;. Very impressive. It&apos;ll be interesting to see how long it takes them to get Silverlight working also (it&apos;s been promised by the end of this year).
				
				</description>
						
				
				<category>BlueDragon.NET</category>				
				
				<category>CFML</category>				
				
				<category>MIX07</category>				
				
				<pubDate>Wed, 16 May 2007 20:13:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=78128D4A-12E4-8122-F214137D36667333</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>MIX07 - Silverlight and the .NET Dynamic Language Runtime (DLR)</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=12175A5A-D4D4-136B-C06412685A5945A4</link>
				<description>
				
				The big news from last week&apos;s &lt;a href=&apos;http://www.visitmix.com/&apos; target=&apos;_blank&apos;&gt;MIX07&lt;/a&gt; conference all surrounded Microsoft&apos;s new &lt;a href=&apos;http://silverlight.net/Default.aspx&apos; target=&apos;_blank&apos;&gt;Silverlight&lt;/a&gt; browser plug-in for creating rich internet applications (RIA). The two things I&apos;m most excited about are the integrated Common Language Runtime (CLR) within Silverlight 1.1, and the new Dynamic Language Runtime (DLR) for .NET, both announced and demonstrated for the first time at MIX07. More on both of these topics later in this blog entry.

While many bloggers and journalists have focused on comparisions between Silverlight and Flash, I honestly don&apos;t know enough about Flash--or even Silverlight, yet--to be able to contribute to that discussion from a technical perspective. But based on what I&apos;ve seen and read so far, if I had to speculate on the market impact of Silverlight, I&apos;d make three guesses:&lt;ol&gt;&lt;li&gt;the majority of people who currently use Flash will probably not flock to Silverlight, but will continue to use the Flash tools and technology they&apos;ve invested in and are familiar with;
&lt;li&gt;some people who currently use Flash will begin to experiment with Silverlight, but will use Silverlight in addition to Flash, not as a replacement; and,
&lt;li&gt;there are many, many companies and organizations who currently don&apos;t use Flash at all, but who will begin to look at Silverlight for RIA development.
&lt;/ol&gt;

The bottom line is I expect to see significant adoption of Silverlight--particularly by Microsoft shops--but not necessarily a diminishing use of Flash as a result. Both Flash and Silverlight are probably here to stay for the long term.

Silverlight is a cross-platform, cross-browser plug-in for displaying rich multi-media user interfaces. &quot;Cross-platform&quot; is currently Windows and Mac OS X Intel (not PPC), though there is talk of a non-Microsoft open source implementation for Linux by the same people who created Mono (an implementation of .NET for Linux). &quot;Cross-browser&quot; is currently IE, Firefox, and Safari, and future support for Opera has been announced by Microsoft. At all of the sessions I attended, the presenters made sure to show all of their demos running on both Windows and Mac on a variety of browsers.

Silverlight user interfaces are defined in XML files called XAML files. The attributes of XAML files are exposed by Silverlight to JavaScript in the browser. In Silverlight 1.0 (currently in beta), behavior--for example, what happens when a user clicks on an image--is controlled via JavaScript that executes within the browser&apos;s scripting engine, not within Silverlight. One nice feature of XAML files is that they can be created by designers using Expression Blend and then opened by developers using Visual Studio to add code and behavior.

One of the most important announcements at MIX07 is that Silverlight 1.1 (currently in alpha) includes a cross-platform version of the .NET CLR, which means that behavior can be controlled by .NET code programmed in C#, Visual Basic.NET, or any .NET programming language. Silverlight exposes the HTML DOM to the embedded CLR, so that .NET code running within Silverlight can interact with the DOM (think of being able to write AJAX-style client applications in C# instead of JavaScript). The entire download of Silverlight 1.1, including the CLR, is about 4.2MB.

Finally, Microsoft announced the &lt;a href=&apos;http://www.iunknown.com/2007/05/clearing_the_ai.html&apos; target=&apos;_blank&apos;&gt;Dynamic Language Runtime (DLR)&lt;/a&gt; enhancements to the .NET CLR. These enhancmenents apply to both the &quot;full&quot; desktop/server CLR and the version integrated with Silverlight 1.1. The DLR is derived from work on the &lt;a href=&apos;http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&apos; target=&apos;_blank&apos;&gt;IronPython&lt;/a&gt;, an implementation of the Python programming language for .NET. The idea of the DLR is to provide a common support layer for implementing dynamic languages on .NET. Microsoft showed demonstrations of IronRuby--an implementation of Ruby for .NET based on the DLR--as well as DLR-based implementations of JScript and Visual Basic.

Hmmm...are there any other dynamic langauges that might be candidates for implementation on the DLR? What about CFML? &quot;IronDragon&quot; anyone? What might a DLR-based CFML implementation look like and allow you to do that you can&apos;t currently do? Imagine being able to do things like:&lt;ul&gt;&lt;li&gt;compile CFML code into .NET assemblies (.dll)
&lt;li&gt;have CFCs subclass (inherit from) any .NET class written in any .NET language (C#, Visual Basic.NET, IronPython, etc.)
&lt;li&gt;have .NET classes written in any .NET language subclass (inherit from) CFCs
&lt;li&gt;be able to use CFML anywhere you can use C#, Visual Basic.NET, etc., to create any type of .NET-based application
&lt;li&gt;create AJAX-style applications running CFML within the browser (within the CLR integrated within Silverlight 1.1)
&lt;li&gt;have IntelliSense and debugging support for CFML within Visual Studio
&lt;/ul&gt;

We&apos;ve all heard the phrase &quot;CF is Java&quot; and while I recognize the underlying truth this phrase is intended to convey, I&apos;ve always been bothered by a fundamental &quot;untruth&quot; in this phrase. CF is not Java in that writing CFML code is not the same as writing Java code. &quot;CF is Java&quot; is basically a marketing phrase that hides as much technical truth as it reveals. It&apos;s probably more technically accurate to say &quot;ColdFusion is a Java application&quot; (or, &quot;BlueDragon is a Java application&quot;), but also that &quot;CFML (the programming language) is not Java.&quot;

With the DLR, I think there&apos;s an opportunity to say, &quot;CFML is .NET&quot; and mean it in the fullest sense. There&apos;s an opportunity to make CFML a &quot;first class&quot; language for .NET, fully equivalent to and interoperable with C#, Visual Basic.NET, IronPython, IronRuby, JScript, etc. In other words, writing CFML code for .NET would be the same as writing code in any other .NET language. It&apos;s this opportunity, along with possibility of running CFML code within the browser (within Silverlight) that has me most excited.

I&apos;m going to Redmond the week after next (May 21-23) to work with the DLR team to learn more about what they&apos;ve done and how we might create a DLR-based CFML implementation. I&apos;ll post more information as I learn more, and hopefully we&apos;ll even have something to demonstrate at &lt;a href=&apos;http://cfunited.com/&apos; target=&apos;_blank&apos;&gt;CFUNITED-07&lt;/a&gt;.

P.S. Here&apos;s a &lt;a href=&apos;http://weblogs.asp.net/scottgu/archive/2007/05/07/silverlight.aspx&apos; target=&apos;_blank&apos;&gt;must-read blog entry by Scott Guthrie&lt;/a&gt; that talks about Silverlight, the embedded CLR, and the DLR in more detail.

&lt;b&gt;May 12 UPDATE:&lt;/b&gt; after digging through the DLR for the better part of the day today, I&apos;m even more excited about what I think we&apos;re going to be able to accomplish, and how quickly. It looks like one additional benefit I hadn&apos;t thought about is the ability to create and invoke CFCs from other .NET languages using the native syntax of that language. For example, you&apos;ll be able to create CFCs from C# using the &quot;new&quot; operator rather than having to rely on a JavaProxy-like implementation. This illustrates the &quot;deep&quot; level of integration we&apos;ll be able to achieve with .NET via the DLR versus current CFML implementations on .NET or Java.
				
				</description>
						
				
				<category>BlueDragon.NET</category>				
				
				<category>CFML</category>				
				
				<category>MIX07</category>				
				
				<pubDate>Fri, 11 May 2007 10:35:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=12175A5A-D4D4-136B-C06412685A5945A4</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Duck Typing and Performance - Revisited</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=9E624A8C-1122-E9CE-A0799A2FA851DCA0</link>
				<description>
				
				I finally got some time free to dig into the question of Duck Typing and performance that was originally raised by &lt;a href=&apos;http://corfield.org/articles/ducktyping_cfunited.pdf&apos; target=&apos;_blank&apos;&gt;Sean Corfield&apos;s presentation at CFUNITED-06&lt;/a&gt;. My goal was to measure the performance effect of Duck Typing on BlueDragon 7.0, and to compare that to the effect on CFMX 7.0.2. But the results really surprised me, to say the least.

I downloaded the &lt;a href=&apos;http://corfield.org/articles/quack.zip&apos;&gt;sample code&lt;/a&gt; from Sean&apos;s presentation and ran the &quot;performance.cfm&quot; template on CFMX 7.0.2 (after turning on CFTIMER output in Debug Settings). Much to my surprise, I saw no consistent differences between the Typed and Untyped method calls over successive refreshes of the page. In fact, sometimes the Typed calls were faster than the Untyped calls! The differences were usually only a few milliseconds, though sometimes the Untyped calls were up to twice as fast as the Typed calls. Never did I see the &quot;30-40 times&quot; performance advantage of the Untyped calls that &lt;a href=&apos;http://www.pbell.com/index.cfm/2006/7/2/Duck-Typing-for-Performance&apos; target=&apos;_blank&apos;&gt;others have reported&lt;/a&gt;.

Then I tried on BlueDragon.NET 7.0. Same results. The timing differences were generally only a few milliseconds, and sometimes the Typed calls were faster. Hmmm...

Then I increased the number of iterations from 1000 to 10,000. OK, now I&apos;m seeing some consistent results. On both CFMX and BlueDragon, the Untyped calls are consistently faster than the Typed calls, but not by a whole lot. The Untyped calls generally take only about 75% as long to execute as the Typed calls. For example, in one execution where the Typed calls took 125ms to execute, the Untyped calls took 93ms. That&apos;s a 32ms savings (about 26%) over 10,000 method calls--hardly worth getting excited about.

Maybe the difference with what others have reported is due to the hardware or operating system. I&apos;m testing on Windows Server 2003. The server hardware is: 3.0GHz dual-CPU Xeon processors with hyperthreading and 1.0GB RAM. That&apos;s a pretty beefy machine, but not outrageously so (I&apos;m sure it cost less than $2000--probably closer to $1500). Maybe slower hardware or a different operating system would show different results.

Based on these results (and with the &lt;a href=&apos;http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=97A790C6-13C3-71E3-27BA15D212DA96A1&apos; target=&apos;_blank&apos;&gt;usual caveats about &quot;loop 10,000 times&quot; micro-benchmarks&lt;/a&gt;), I&apos;d have to agree with Sean&apos;s view that &lt;a href=&apos;http://corfield.org/blog/index.cfm/do/blog.entry/entry/Duck_Typing_is_not_about_Performance&apos; target=&apos;_blank&apos;&gt;Duck Typing is not about performance&lt;/a&gt;. In fact, I&apos;d go further and say the question of performance is completely irrelevant to the decision of whether to use Duck Typing or go with a &quot;Java-like&quot; typed approach.
				
				</description>
						
				
				<category>CFML</category>				
				
				<pubDate>Wed, 18 Apr 2007 13:34:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=9E624A8C-1122-E9CE-A0799A2FA851DCA0</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>CFUNITED-07: The Future of BlueDragon/CFML</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=F80967A2-6777-14D1-AAF811AB231F5C4B</link>
				<description>
				
				The topic for New Atlanta&apos;s &lt;a href=&apos;http://cfunited.com/go/topics#topic-1380&apos; target=&apos;_blank&apos;&gt;keynote at CFUNITED-07&lt;/a&gt; has been posted. From the CFUNITED web site:
&lt;blockquote&gt;With the breakthrough release of BlueDragon 7.0 in March 2007, New Atlanta is now looking towards the future: contemplating, researching, and implementing evolutionary and revolutionary enhancements to BlueDragon and CFML. During this keynote presentation, the company that pioneered CFML innovations such as standard J2EE WAR/EAR deployment, image manipulation (CFIMAGE), .NET integration, and multi-threaded programming (CFTHREAD) offers their vision of the future. This keynote will include demonstrations of near-term BlueDragon enhancements to be delivered in late 2007 and early 2008, as well as a discussion of longer-term research projects that could fundamentally change the way you use CFML.&lt;/blockquote&gt;I wish I could give more details now, but that would take all the fun out of it, wouldn&apos;t it? This is one you&apos;re not going to want to miss.
				
				</description>
						
				
				<category>CFUNITED</category>				
				
				<category>CFML</category>				
				
				<category>BlueDragon</category>				
				
				<pubDate>Mon, 16 Apr 2007 15:24:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=F80967A2-6777-14D1-AAF811AB231F5C4B</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>CFIMAP and CFZIP tags in BlueDragon</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=5D8F99EE-141E-6903-B0B513052FD1A224</link>
				<description>
				
				A somtimes overlooked CFML enhancement that BlueDragon added in its very first release in 2002 (gosh, has it really been almost five years?!) is the CFIMAP tag. From the &lt;a href=&apos;http://www.newatlanta.com/products/bluedragon/self_help/docs/7_0/BlueDragon_70_CFML_Enhancements_Guide.pdf&apos; target=&apos;_blank&apos;&gt;BlueDragon 7.0 CFML Enhancements Guide&lt;/a&gt;, Section 4.3.10:

&lt;blockquote&gt;The CFIMAP tag allows you to interact with both IMAP and POP mail servers (CFIMAP may be used instead of CFPOP to interact with POP mail servers). Generally, the sequence of steps to interact with a mail server is:
&lt;ol&gt;&lt;li&gt;Open a connection to the mail server (OPEN action).
&lt;p&gt;&lt;li&gt;Get a list of folders from the mail server (LISTALLFOLDERS action).
&lt;p&gt;&lt;li&gt;Get a list of messages within a specific folder (LISTMAIL action).
&lt;p&gt;&lt;li&gt;Perform actions with specific messages (READMAIL, MARKREAD, DELTEMAIL, and MOVEMAIL actions).
&lt;p&gt;&lt;li&gt;Perform actions with folders (DELETEFOLDER and RENAMEFOLDER actions).
&lt;p&gt;&lt;li&gt;Close the connection (CLOSE action).&lt;/ol&gt;&lt;/blockquote&gt;Another useful pair of tags that were added in BlueDragon 6.0 are CFZIP and CFZIPPARAM, which are used to &quot;create, extract, and list the contents of compressed ZIP files&quot; (Section 4.3.18 of the BlueDragon 7.0 CFML Enhancements Guide). If you need to manipulate ZIP files from CFML, check these out!

BlueDragon has been introducing new CFML enhancements in every release since 2002. Some are major and get lots of attention, such as CFIMAGE--which was also introduced by BlueDragon in its first release in 2002--and CFTHREAD and CFC Interfaces that were added in BlueDragon 7.0. Some are less flashy, such as CFIMAP and CFZIP. All are useful.

So if you&apos;re using BlueDragon, be sure to spend some time reviewing the BlueDragon CFML Enhancements Guide to make sure you&apos;re getting the most from your investment.
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>BlueDragon</category>				
				
				<pubDate>Thu, 05 Apr 2007 07:50:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=5D8F99EE-141E-6903-B0B513052FD1A224</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Mark Drew on CFC Interfaces and CFEclipse</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=1365FDEE-8D0F-C8E4-996312693A42205E</link>
				<description>
				
				&lt;a href=&apos;http://www.markdrew.co.uk/blog/index.cfm/2007/2/1/DuckTyping-Interfaces-CFEclipse--and-how-I-write-code&apos; target=&apos;_blank&apos;&gt;Mark Drew has posted a blog entry that points out another benefit of CFC Interfaces&lt;/a&gt;. By using interfaces, your IDE (CFEclipse in this case) can check your CFCs for correctness before your code is ever executed. The earlier you can find and correct errors in your code, the better off you are. As Mark explains, interfaces, along with an IDE that understands them, can allow you to detect errors as you&apos;re writing your code.
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>BlueDragon</category>				
				
				<pubDate>Thu, 01 Feb 2007 17:54:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=1365FDEE-8D0F-C8E4-996312693A42205E</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Why Interfaces in CFML *Are* Relevant (a Rebuttal to Brandon Harper, Part I)</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=151A320B-6EBB-122A-9D45157E58B8EE29</link>
				<description>
				
				Last week, &lt;a href=&apos;http://devnulled.com/content/2007/01/latest-article-why-interfaces-in-coldfusion-are-irrelevant/&apos; target=&apos;_blank&apos;&gt;Brandon Harper&lt;/a&gt; published an article in CFDJ entitled, &quot;&lt;a href=&apos;http://coldfusion.sys-con.com/read/317593_p.htm&apos; target=&apos;_blank&apos;&gt;Why Interfaces in ColdFusion Are Irrelevant&lt;/a&gt;.&quot; His article is concise and clearly written, and should definitely be read before continuing here. However, Brandon&apos;s article contains a number of factual and logical errors that tend to undermine his conclusions. I would like to offer several rebuttals to his arguments, starting with the central statement of his summary:

&lt;blockquote&gt;&quot;Any implementation of interfaces in the CFML language would essentially only represent a difference in semantics to other ways already available to implement interface-like objects...without providing the safety that interfaces should provide.&quot;&lt;/blockquote&gt;

I&apos;d like to focus on the first part of this sentence, prior to the &quot;...&quot;, which I added. I&apos;ll come back later in a follow-up blog entry to address the final part of this statement, as well as other factual and logical errors in his article.

(First, as a side note, I believe Brandon is using the word &quot;semantics&quot; incorrectly here. In computer science terms, &quot;syntax&quot; refers to the formal way a concept is expressed in a programming language, &quot;semantics&quot; refers to the meaning of the statement. For example, the following are two different syntaxes for expressing the same semantics in the Java programming language:

&lt;blockquote&gt;i = i + 1;
i += 1;&lt;/blockquote&gt;

The high-level &quot;semantics&quot; or meaning of these statements is exactly the same--the variable &quot;i&quot; is being incremented by 1--only the syntax is different. So what I think Brandon really meant to say is:

&lt;blockquote&gt;&quot;Any implementation of interfaces in the CFML language would essentially only represent a difference in &lt;b&gt;syntax&lt;/b&gt; to other ways already available to implement interface-like objects...without providing the safety that interfaces should provide.&quot;&lt;/blockquote&gt;

Differences in syntax are sometimes cosmetic and may or may not be meaningful; differences in semantics are always meaningful. I don&apos;t think this unintentional misue of &quot;semantics&quot; versus &quot;syntax&quot; takes away from the points Brandon is trying to make in his article.)

What Brandon is saying is that support for interfaces in CFML is only &quot;syntactic sugar&quot; that does not have any meaning (semantics) that are different from what can be achieved in other ways using existing CFML programming language syntax. This is factually incorrect in several ways because there are in fact a number of important semantic differences between &quot;true&quot; CFML interfaces as implemented in BlueDragon 7.0 and the &quot;pseudo-interfaces&quot; he describes in his article.

The first factual error results from an underlying logical fallacy that&apos;s common among CFML programmers, that goes something like this (my words, not Brandon&apos;s): &quot;CFML is not compiled, therefore all errors are runtime errors, and all runtime errors are the same&quot;. It&apos;s true that CFML is not compiled prior to being deployed--that you deploy the &quot;raw&quot; CFML source code and not compiled objects.

However, it&apos;s also true that both BlueDragon and CFMX use a two-stage &quot;compile-then-execute&quot; technique for rendering CFML pages and CFCs. The results of the &quot;compile&quot; stage are cached in the File Cache so that subsequent renderings of a page only perform the &quot;execute&quot; stage. You can think of this as a sort of &quot;just-in-time&quot; compiling of CFML pages and CFCs; that is, they&apos;re not compiled until they&apos;re needed. CFML pages are compiled the first time they&apos;re requested; CFCs are compiled the first time they&apos;re instantiated via CFOBJECT or CreateObject.

This &quot;compile-then-execute&quot; process results in two broadly different types of errors that can be detected and reported by BlueDragon and CFMX. The first class of errors are syntax errors; that is, errors made by the programmer that violate the formal syntax specified for CFML tags or functions. Syntax errors are detected during the &quot;compile&quot; stage of page rendering.

Consider the following code. My daughter Lindsay&apos;s birthday is on January 24 (she turns 21 this year...sigh...). I wrote the following code to send her an mail on her birthday. But this code has a problem; the syntax of the CFMAIL tag requires the TO attribute, which is missing:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfif dateCompare( now(), &quot;1/24/2007&quot;, &quot;d&quot; ) eq 0&gt;
    &amp;lt;cfmail from=&quot;vince@newatlanta.com&quot; subject=&quot;Happy Birthday!&quot;&gt;
        &amp;lt;cfmailparam file=&quot;birthdaygreeting.txt&quot;&gt;
    &amp;lt;/cfmail&gt;
&amp;lt;/cfif&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

If you run this code on either BlueDragon or CFMX, you&apos;ll get a compile-time syntax error about the missing TO attribute no matter what day it is. That is, the code is not being rendered at compile time, but the entire page is being parsed for syntax errors. Syntax errors are detected regardless of whether the code is going to be executed at runtime or not.

So now let&apos;s fix the CFMAIL tag to add the TO attribute (sorry, guys, that&apos;s not her real email address). Now the code is syntactically correct and will compile successfully on both BlueDragon and CFMX. But what if the &quot;birthdaygreeting.txt&quot; file doesn&apos;t exist? When will that produce an error? It will only produce an error when the CFMAILPARAM tag is actually rendered at runtime:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfif dateCompare( now(), &quot;1/24/2007&quot;, &quot;d&quot; ) eq 0&gt;
    &amp;lt;cfmail from=&quot;vince@newatlanta.com&quot; to=&quot;lindsay@newatlanta.com&quot;
subject=&quot;Happy Birthday!&quot;&gt;
        &amp;lt;cfmailparam file=&quot;birthdaygreeting.txt&quot;&gt;
    &amp;lt;/cfmail&gt;
&amp;lt;/cfif&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

That&apos;s the fundamental difference between syntax errors and runtime errors: syntax errors are detected regardless of whether the code is executed, and runtime errors are only detected when (and if) the code is executed. In general, the earlier you can catch an error in your code the better off you are. It&apos;s better and easier to catch and fix syntax errors than it is to catch and fix runtime errors.

Having established the difference between compile-time syntax errors and runtime errors in CFML, let&apos;s see how this applies to interfaces. Here&apos;s the pseudo-interface example given by Brandon in his article (note that due to a publishing error, the EXTENDS=&quot;Foo&quot; attribute is missing from the Bar.cfc CFCOMPONENT tag and that I&apos;ve added it here:

foobar/Foo.cfc

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent hint=&quot;Interface for foo&quot;&gt;
    &amp;lt;cffunction name=&quot;init&quot; returntype=&quot;any&quot;&gt;
        &amp;lt;return this/&gt;
    &amp;lt;/cffunction&gt;

    &amp;lt;cffunction name=&quot;implementThis&quot; returntype=&quot;any&quot;&gt;
        &amp;lt;cfthrow message=&quot;foobar.Foo: implementThis() must be implemented&quot;&gt;
    &amp;lt;/cffunction&gt;
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

foobar/Bar.cfc

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent extends=&quot;Foo&quot; hint=&quot;Provides foobar functionality&quot;&gt;
    &amp;lt;cffunction name=&quot;init&quot; returntype=&quot;any&quot;&gt;
        &amp;lt;return this/&gt;
    &amp;lt;/cffunction&gt;

    &amp;lt;cffunction name=&quot;implementThis&quot; returntype=&quot;any&quot;&gt;
        &amp;lt;cfreturn true/&gt;
    &amp;lt;/cffunction&gt;
&amp;lt;/cfcomponent&gt; 
&lt;/pre&gt;&lt;/blockquote&gt;

Brandon&apos;s point is that if you create a subclass of Foo.cfc but don&apos;t override the &quot;implementThis&quot; function, you&apos;ll get a runtime error when someone tries to invoke &quot;implementThis&quot;, and--in his opinion--that&apos;s just as good as interfaces. Well, it&apos;s not just as good as interfaces, which is easy to demonstrate if you followed my discussion of compile-time syntax errors versus runtime errors, above. Here&apos;s what Brandon&apos;s example would look like using interfaces as implemented in BlueDragon 7.0:

foobar/Foo.cfc

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent &lt;font color=&quot;red&quot;&gt;type=&quot;interface&quot;&lt;/font&gt; hint=&quot;Interface for foo&quot;&gt;
    &amp;lt;cffunction name=&quot;implementThis&quot; &lt;font color=&quot;red&quot;&gt;type=&quot;abstract&quot;&lt;/font&gt; returntype=&quot;any&quot;/&gt;
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

foobar/Bar.cfc

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent &lt;font color=&quot;red&quot;&gt;implements=&quot;Foo&quot;&lt;/font&gt; hint=&quot;Provides foobar functionality&quot;&gt;
    &amp;lt;cffunction name=&quot;init&quot; returntype=&quot;any&quot;&gt;
        &amp;lt;return this/&gt;
    &amp;lt;/cffunction&gt;

    &amp;lt;cffunction name=&quot;implementThis&quot; returntype=&quot;any&quot;&gt;
        &amp;lt;cfreturn true/&gt;
    &amp;lt;/cffunction&gt;
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

Now let&apos;s assume there&apos;s a third CFC, named &quot;Baz&quot;, that violates the interface &quot;contract&quot; by not implementing the &quot;implementThis&quot; function. Using Brandon&apos;s pseudo-interface technique, Baz.cfc would look like this:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent extends=&quot;Foo&quot; hint=&quot;Provides foobar functionality&quot;&gt; 
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

Using BlueDragon 7.0 interface syntax, Baz.cfc would look like this:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent implements=&quot;Foo&quot; hint=&quot;Provides foobar functionality&quot;&gt;
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

Now let&apos;s look at some code that actually tries to use Baz.cfc and figure out when (or if), and what types of error are generated:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfset myBaz = createObject( &quot;component&quot;, &quot;foobar.Baz&quot; )&gt;
&amp;lt;cfif dateCompare( now(), &quot;1/24/2007&quot;, &quot;d&quot; ) eq 0&gt;
    &amp;lt;cfset myBax.implementThis()&gt;
&amp;lt;/cfif&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

With Brandon&apos;s pseudo-interfaces, you&apos;ll only get an error is you actually try to invoke the &quot;implementThis&quot; function on an instance of Baz. In BlueDragon 7.0, you&apos;ll receive an error as soon as the CreateObject function is executed; that is, when an instance of Baz.cfc is compiled and instantiated. In other words, BlueDragon 7.0 has raised the error checking of interfaces to the level of compile-time syntax errors, which means they&apos;ll be easier to find and fix than the runtime errors which may or may not be generated by Brandon&apos;s pseudo-interfaces.

So getting back to Brandon&apos;s central assertion:

&lt;blockquote&gt;&quot;Any implementation of interfaces in the CFML language would essentially only represent a difference in (syntax) to other ways already available to implement interface-like objects...&quot;&lt;/blockquote&gt;

We can see that interfaces in CFML in BlueDragon 7.0 represent not just a difference in syntax from Brandon&apos;s pseudo-constructor, but have a meaningful semantic difference in when errors are detected and reported by the CFML server engine.

There are several other important differences. If Foo.cfc is only intended to serve as an interface, then it should not be possible to create a concrete instance of Foo. That is, the following code should fail, which it will on BlueDragon 7.0:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfset myFoo = createObject( &quot;component&quot;, &quot;foobar.Foo&quot; )&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

However, using Brandon&apos;s pseudo-interfaces, the above statement is perfectly legal and you&apos;ll only get a runtime error when, or if, you try to invoke the &quot;implementThis&quot; function on an (illegal) instance of Foo.

Finally, Brandon&apos;s pseudo-interfaces rely on subclassing via the EXTENDS attribute of the CFCOMPONENT tag. The problem will this is that--like Java and C#--CFML only supports single inheritance. This means that using Brandon&apos;s pseudo-interfaces you can only &quot;implement&quot; a single interface, and you can&apos;t both extend a &quot;regular&quot; CFC and also implement one or more interfaces. All of this is allowed by the syntax of BlueDragon 7.0; for example:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent extends=&quot;mySuperClass&quot; implements=&quot;interfaceA,interfaceB&quot;&gt;
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

This issue of multiple inheritance or multiple interfaces was brought up on &lt;a href=&apos;http://devnulled.com/content/2007/01/latest-article-why-interfaces-in-coldfusion-are-irrelevant/&apos; target=&apos;_blank&apos;&gt;the discussion on Brandon&apos; blog&lt;/a&gt;, and the answer some would offer is: &quot;but I don&apos;t need multiple inheritance or multiple interfaces--I can just use Duck Typing and Mixins!&quot;

Well, my &lt;a href=&apos;http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=F17880FB-12E2-D573-B881AA26B14EBCC5&apos; target=&apos;_blank&apos;&gt;opinions about Duck Typing and Mixins&lt;/a&gt; are well-known and don&apos;t need repeating here. The kindest thing I can say about Duck Typing and Mixins is that these are new, experimental, and unproven techniques. Whether they prove to be generally useful and become standard practice in the long term remains to be seen. Interfaces, on the other hand, have been proven in over a decade or more of use in developing commercial applications in C++, Java, and C#. (Yes, I know that C++ does not support an &quot;interface&quot; keyword; interfaces in C++ are implemented using abstract base classes that contain only pure virtual functions, and multiple inheritance).

I suspect any argument of multiple inheritance (or multiple interfaces) via Duck Typing/Mixins versus BlueDragon 7.0 interfaces would follow pretty much along the same lines as I&apos;ve discussed above.

In conclusion, Brandon&apos;s central argument that, &quot;Any implementation of interfaces in the CFML language would essentially only represent a difference in (syntax) to other ways already available to implement interface-like objects...&quot;, is wrong on at least three points:

&lt;ol&gt;
&lt;li&gt;There is an important difference of when errors are detected and reported by the CFML runtime. (BlueDragon 7.0 reports compile-time syntax errors when CFCs are instantiated, which are better than runtime errors that only happen when, or if, you try to invoke a non-implemented interface function).

&lt;li&gt;There is a difference of whether interface CFCs are allowed to be instantiated (this should not be allowed, as in BlueDragon 7.0).

&lt;li&gt;There is a difference in the ability for a CFC to implement multiple interfaces while at the same time preserving the ability to extend a concrete base class (this can only be done in BlueDragon 7.0).
&lt;/ol&gt;

Again, as time permits, I&apos;ll tackle what I see as the other flaws in Brandon&apos;s arguments, but this pretty much covers his central point.

P.S. If you want to know more about the implementation of interfaces and abstract CFCs in BlueDragon 7.0, read the following:

&lt;blockquote&gt;&lt;a href=&apos;http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=153E8968-1259-8AD9-6C7714F427BA183D&apos;&gt;Interfaces and Abstract CFCs in BlueDragon 7.0&lt;/a&gt;

&lt;a href=&apos;http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=138253B4-11D2-F422-8F69AE73580EF030&apos;&gt;Interfaces in Action: the Observer/Event Listener Design Pattern&lt;/a&gt;
&lt;/blockquote&gt;
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>BlueDragon</category>				
				
				<pubDate>Sun, 14 Jan 2007 11:42:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=151A320B-6EBB-122A-9D45157E58B8EE29</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Mark Anders on strong typing</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=1070B449-C641-99D1-F3CB8C4300F548F3</link>
				<description>
				
				&lt;a href=&apos;http://www.forta.com/blog/index.cfm/2006/12/18/The-Register-Interviews-Mark-Anders&apos; target=&apos;_blank&apos;&gt;In a recent blog entry&lt;/a&gt;, Ben Forta points to &lt;a href=&apos;http://www.regdeveloper.co.uk/2006/12/15/mark_anders_flash/&apos; target=&apos;_blank&apos;&gt;an interview with Mark Anders&lt;/a&gt;, a former Microsoft employee, and current Adobe employee and Flex 2 developer. Mark has some interesting (not flattering) things to say about Microsoft, .NET, and WPF, but this comment about strong typing in ActionScript really struck me, considering all the recent debate on this topic within the CFML community:

&lt;blockquote&gt;&quot;One thing I was really happy we could do was come up with a variant of ActionScript that’s strongly typed so you get those good compiler messages. When we moved to ActionScript 3, we had to port all this code and there were a number of places where the programmers said ‘How did we ever ship that? That code just doesn&apos;t work’. Once you have real strong typing it ferrets out things you didn&apos;t know were there, even if you&apos;re a great developer.&quot;&lt;/blockquote&gt;

In a comment on Ben&apos;s blog, Mary Branscombe, the interviewer and author of the article, indicates that Mark had more to say about strong typing. Unfortunately, these additional comments had to be cut from the article due to length constraints. I&apos;d really be interested to know what else Mark had to say on this topic.

If strong typing can help even &quot;great developers&quot; find bugs they otherwise missed in their ActionScript code, wouldn&apos;t it have the same benefit for CFML developers?
				
				</description>
						
				
				<category>CFML</category>				
				
				<pubDate>Tue, 19 Dec 2006 10:01:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=1070B449-C641-99D1-F3CB8C4300F548F3</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Comparing CFML Server Performance</title>
				<link>http://blog.newatlanta.com/index.cfm/2006/12/12/Comparing-CFML-Server-Performance</link>
				<description>
				
				A few weeks ago &lt;a href=&apos;http://www.markdrew.co.uk/blog/index.cfm/2006/11/23/Structures-vs-Components-an-unfair-challenge&apos; target=&apos;_blank&apos;&gt;Mark Drew wrote a series of blog entries&lt;/a&gt; on the topic of performance. In fairness to Mark, he does state more than once that his primary goal was to compare the relative performance of creating structs versus CFCs versus Java objects. However, it&apos;s the comparison of various CFML server engines in two of his blog entries that caught many people&apos;s eyes, including mine, and that&apos;s what I&apos;d like to comment on here.

As &lt;a href=&apos;http://www.markdrew.co.uk/blog/index.cfm/2006/11/27/Comparing-Component-speed-on-different-CFML-engines&apos; target=&apos;_blank&apos;&gt;I commented on one of Mark&apos;s blog entries&lt;/a&gt;, the type of &quot;loop 10,000 times&quot; style of micro-benchmarks he used in his testing are seriously flawed. It&apos;s very difficult to draw any broad conclusions or make meaningful generalizations from the results of such tests. Among the problems with these types of tests are:

&lt;ul&gt;
&lt;li&gt;Micro-benchmarks can make differences that are small and insignificant seem large and important, to an arbitrary degree. Let&apos;s assume the difference between two operations is one-tenth of a millisecond; with 10 iterations the difference is one millisecond--insignificant; with 100 iterations the difference is 10 milliseconds--still no big deal; but with 10,000 iterations the difference is 1,000 milliseconds--whoa, that&apos;s a big difference! Want to make the difference seem even larger? Just run more iterations. The question is: how many of these operations do you realistically expect to perform during execution of a single request?

&lt;p&gt;&lt;li&gt;Micro-benchmarks don&apos;t reflect real-world applications. They artificially isolate individual operations and don&apos;t give you any context about the relative importance of these operations versus what else might be happening when you execute a request. For example, accessing an external resource--such as a database, or web service, or LDAP server, or mail server, etc.--is going to hundreds or thousands of times slower (or more!) than executing any tag or function that doesn&apos;t access an external resource.

&lt;p&gt;&lt;li&gt;Micro-benchmarks don&apos;t reflect the real-world execution environment. Most developers use single-processor computers (though this has been changing recently), and the micro-benchmarks are usually executed within a single request. In the real-world, most web servers are multi-processor machines, and the most important question is: how does it behave under load? That is, what does the performance look like when executing multiple requests simultaneously?
&lt;/ul&gt;

The bottom line is that micro-benchmarks can cause you to focus on trivial or insignificant items, and can produce misleading results that don&apos;t translate into the real-world. Micro-benchmarks are like parking your car in the driveway and revving the engine while it&apos;s in neutral to see how fast it&apos;ll go. Sure, you can measure the maximum RPMs, which will give some indication of how fast the car might go, but it doesn&apos;t tell you what&apos;s really going to happen when you put it into gear and head out onto the highway.

In order to illustrate these points, we created some tests that we think are more meaningful (but which still have some serious limitations, as I&apos;ll discuss below), to see what results we&apos;d get. Basically what we did was modify one of Mark&apos;s original tests to remove the nested loops and instead execute the CreateObject function a fixed number of times within a loop:

&lt;code&gt;&lt;cfset x=&quot;100&quot;&gt;     
&lt;cfloop from=&quot;1&quot; to=&quot;#x#&quot; index=&quot;i&quot;&gt;
    &lt;cfset oItem = CreateObject(&apos;component&apos;, &apos;Person&apos;)&gt;
    &lt;cfset oItem.setname(&quot;Bob&quot; &amp;amp; i )&gt;
    &lt;cfset oItem.setage(20)&gt;
&lt;/cfloop&gt;
done!
&lt;/code&gt;

For completeness, here&apos;s what Person.cfc looks like:

&lt;code&gt;&lt;cfcomponent&gt;
    &lt;cfset this.name = &quot;&quot;&gt;
    &lt;cfset this.age = 0&gt;
	
    &lt;cffunction name=&quot;setName&quot;&gt;
        &lt;cfargument name=&quot;name&quot;&gt;
        &lt;cfset this.name = arguments.name&gt;
    &lt;/cffunction&gt;

    &lt;cffunction name=&quot;setAge&quot;&gt;
        &lt;cfargument name=&quot;age&quot;&gt;
        &lt;cfset this.age = arguments.age&gt;
    &lt;/cffunction&gt;
&lt;/cfcomponent&gt;
&lt;/code&gt;

Then we used a commercial load testing tool (Microsoft Application Center Test) configured to run three simultaneous clients with no wait time between requests so there were always three requests executing simultaneously. We ran successive test sessions at increments of 100--first 100 CreateObject calls, then 200, then 300, etc., up to 1000--and measured the average response times for one-minute test durations.

The test server has dual-CPU 3.0GHz Intel Xeon processors with hyperthreading, 1.0GB of RAM, and is running Windows Server 2003 and IIS 6.0 (that is, it&apos;s a pretty typical modern web server). We ran the tests with CFMX 7.0.2, BlueDragon Server JX 6.2.1 and 7.0 beta2, BlueDragon.NET 6.2.1 and 7.0 beta2, and just for fun, last night&apos;s developer build of BD JX and BD.NET 7.0 (we&apos;ve done some performance enhancements in the the month or so since BD 7.0 beta2 was built and I was curious to see how it did).

Here are the results, which are quite different from Mark&apos;s micro-benchmarks (click to get a larger image):

&lt;center&gt;&lt;a href=&apos;http://blog.newatlanta.com/images/createObject.jpg&apos; target=&apos;_blank&apos;&gt;&lt;img src=&apos;http://blog.newatlanta.com/images/createObject.jpg&apos; width=&apos;384&apos; height=&apos;280&apos;&gt;&lt;/a&gt;&lt;/center&gt;

What can we conclude from these results? For one thing, if you relied on Mark&apos;s micro-benchmarks to conclude that BlueDragon is slower than CFMX for CreateObject calls, you&apos;d be wrong. However, I&apos;d caution against generalizing too broadly from these results, because these tests contain some (but not all) of the same flaws as the micro-benchmarks.

For example, while you may have an application that creates 100, or 500, or even 1000 CFCs via CreateObject, are they really going to be all of the same type? Probably not. And the Person.cfc from Mark&apos;s tests is pretty simple--what happens if you&apos;re creating CFCs that contains dozens of functions that contain lengthy or complex logic of their own instead of just two simple setters? How will that affect performance?

Further, I only had three simultaneous clients running (though with no wait times, this is a higher load that you might think at first). What happens if this is higher? or lower? or if we add wait times?

My main point is that the only meaningful performance testing is testing of your application in your production environment under traffic conditions that you reasonably expect to see in the real world. Be skeptical of any artificial performance benchmarks--especially micro-benchmarks--and always look at them with a critical eye with the questions: &quot;How generalizable are these results?&quot; and &quot;How do these results relate to the real world?&quot;.

There&apos;s only one way for you to know which CFML server is the fastest for you and your application: test them yourself.

One final point. We do all of our performance testing of BlueDragon on multi-CPU servers using external load testers to generate various levels of traffic. Any claims we make regarding BlueDragon performance are based on these types of tests, and testing of real-world customer applications, and not on micro-benchmarks nor any testing that relies on the server measuring itself (as is typically done with micro-benchmarks).
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>General Software &amp;amp; Computing</category>				
				
				<pubDate>Tue, 12 Dec 2006 18:56:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm/2006/12/12/Comparing-CFML-Server-Performance</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Interfaces in Action: the Observer/Event Listener Design Pattern</title>
				<link>http://blog.newatlanta.com/index.cfm/2006/10/27/Interfaces-in-Action-the-ObserverEvent-Listener-Design-Pattern</link>
				<description>
				
				As I began working on a DirectoryWatcher example to demonstrate how &lt;a href=&apos;http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=EE435309-1031-5704-F5A28CD7466FC690&apos; target=&apos;_blank&apos;&gt;the new BlueDragon 7.0 CFTHREAD tag can be used to implement Event Gateways&lt;/a&gt;, I realized that this example also presents a great opportunity to demonstrate one use for &lt;a href=&apos;http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=153E8968-1259-8AD9-6C7714F427BA183D&apos; target=&apos;_blank&apos;&gt;CFC Interfaces&lt;/a&gt;. I&apos;ll talk more about the DirectoryWatcher and CFTHREAD in a future blog entry, but would like to focus on its use of CFC Interfaces right now; in the mean time, &lt;a href=&apos;/enclosures/BlueDragon_70_DirectoryWatcher.zip&apos;&gt;you can download the DirectoryWatcher code here&lt;/a&gt;.

The &lt;a href=&apos;http://en.wikipedia.org/wiki/Observer_pattern&apos; target=&apos;_blank&apos;&gt;Observer Pattern&lt;/a&gt; (which is also known as the Event Listener Pattern, and is sometimes referred to as Publish/Subscribe), is the first pattern discussed in &lt;a href=&apos;http://www.amazon.com/Head-First-Design-Patterns/dp/0596007124/ref=pd_sim_b_4/104-0939674-7071103&apos; target=&apos;_blank&apos;&gt;Head First Design Patterns&lt;/a&gt; (Freeman), which says (p. 37) that: &quot;The Observer Pattern is one of the most heavily used patterns in the Java Development Kit (JDK), and it&apos;s incredibly useful.&quot; The Observer is also one of the original patterns described in &lt;a href=&apos;http://www.amazon.com/exec/obidos/ASIN/0201633612/qid=1104136902/sr=2-1/ref=pd_ka_b_2_1/002-5948512-0344069&apos; target=&apos;_blank&apos;&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/a&gt; (Gamma, et al), which formally introduced the concept of design patterns in software engineering when it was first published in 1995.

The basic idea is that some object--known as the Subject or Publisher--is going to produce events or notifications when certain things happen. Other objects--known as Observers or Listeners--can register with the Subject to be notified when these events occur. In fact, you may already be familiar with an implementation of this design pattern in CFML if you use Application.cfc, in which case your Application.cfc is the Listener. The presence of an Application.cfc in a directory is sufficient to register with BlueDragon or CFMX (the Subject) for application event notifications. When an &quot;application start&quot; event happens, for example, your Application.cfc is notified via its onApplicationStart event handler.

In the DirectoryWatcher example, the DirectoryWatcher is the Subject; conceptually, you can think of the DirectoryWatcher as watching the entire file system at all times and producing event notifications whenever a file is added, modified, or deleted. You can create a CFC to register with the DirectoryWatcher to receive event notifications for specific directories, and this is where CFC Interfaces come in. First, we need to create a DirectoryWatcher instance; in the example, this is created within the onApplicationStart function of Application.cfc, which is a pretty good place to do it:

&lt;pre&gt;  &amp;lt;cfset directoryWatcher=createObject(&quot;component&quot;,&quot;DirectoryWatcher&quot;).init()&gt;
&lt;/pre&gt;

Now we need to create a CFC that we can register with the DirectoryWatcher to receive event notifications. But what events does the DirectoryWatcher produce? What functions should our CFC implement and what are the function signatures? Here&apos;s the DirectoryWatcher function used to register event listeners:
 
&lt;pre&gt;    &amp;lt;cffunction name=&quot;addListener&quot; access=&quot;public&quot; returntype=&quot;void&quot;&gt;
        &amp;lt;cfargument name=&quot;directoryPath&quot; type=&quot;string&quot; required=&quot;true&quot;&gt;
        &amp;lt;cfargument name=&quot;listener&quot; &lt;font color=&quot;red&quot;&gt;type=&quot;DirectoryListener&quot;&lt;/font&gt; required=&quot;true&quot;&gt;
        ...
    &amp;lt;/cffunction&gt;
&lt;/pre&gt;

Hmmm...the second argument to the addListener function is a CFC of type DirectoryListener. That&apos;s a clue. Let&apos;s take a look at DirectoryListener.cfc:

&lt;pre&gt;    &amp;lt;cfcomponent &lt;font color=&apos;red&apos;&gt;type=&quot;interface&quot;&lt;/font&gt;&gt;
	
        &amp;lt;cffunction name=&quot;onAdd&quot; access=&quot;public&quot; returntype=&quot;void&quot;&gt;
            &amp;lt;cfargument name=&quot;fileName&quot; type=&quot;string&quot; required=&quot;true&quot;&gt;
            &amp;lt;cfargument name=&quot;lastModified&quot; type=&quot;date&quot; required=&quot;true&quot;&gt;
        &amp;lt;/cffunction&gt;
	
        &amp;lt;cffunction name=&quot;onChange&quot; access=&quot;public&quot; returntype=&quot;void&quot;&gt;
            &amp;lt;cfargument name=&quot;fileName&quot; type=&quot;string&quot; required=&quot;true&quot;&gt;
            &amp;lt;cfargument name=&quot;lastModified&quot; type=&quot;date&quot; required=&quot;true&quot;&gt;
        &amp;lt;/cffunction&gt;
	
        &amp;lt;cffunction name=&quot;onDelete&quot; access=&quot;public&quot; returntype=&quot;void&quot;&gt;
            &amp;lt;cfargument name=&quot;fileName&quot; type=&quot;string&quot; required=&quot;true&quot;&gt;
        &amp;lt;/cffunction&gt;

    &amp;lt;/cfcomponent&gt;
&lt;/pre&gt;

That&apos;s right--DirectoryListener defines an interface that tells me exactly what event notifications I can receive from the DirectoryWatcher, what functions I need to implement to receive those notifications, and what the function signatures are. I don&apos;t want to go into the details of its implementation yet, but in our example, the ImageListener implements the DirectoryListener interface:

&lt;pre&gt;    &amp;lt;cfcomponent &lt;font color=&apos;red&apos;&gt;implements=&quot;DirectoryListener&quot;&lt;/font&gt;&gt;
    ...
    &amp;lt;/cfcomponent&gt;
&lt;/pre&gt;

We can now create an ImageListener and register it with the DirectoryWatcher to receive event notifications for any directory (as in the following code, we can register a single ImageListener to receive notifications for multiple directories):

&lt;pre&gt;    &amp;lt;cfscript&gt;
    imageListener = createObject( &quot;component&quot;, &quot;ImageListener&quot; );
    directoryWatcher.addListener( &quot;C:\temp\images\&quot;, imageListener );
    directoryWatcher.addListener( &quot;C:\uploads\images\&quot;, imageListener );
    &amp;lt;/cfscript&gt;
&lt;/pre&gt;

We&apos;re able to pass an ImageListener to the addListener function because it satisfies the contract of that function as specified in the CFARGUMENT tag TYPE=&quot;DirectoryListener&quot; attribute: ImageListener implements the DirectoryListener interface. This is what interfaces are for: to define, document, and enforce the contracts between interacting objects and their functions.

At this point, my Duck Typing, anti-Interfaces friends might raise an objection: but the DirectoryWatcher example can be implemented without using interfaces! Well, yes, it can (after all, Application.cfc doesn&apos;t use interfaces). There are two ways this example could be modified to not use interfaces:
&lt;ol&gt;
&lt;li&gt;Instead of defining it as an interface, the DirectoryListener can just be a &quot;regular&quot; CFC. Then, the ImageListener would subclass (extend) DirectoryListener and everything will be fine. In some cases this is a reasonable alternative. But there are two drawbacks to this approach:
    &lt;ol type=&quot;a&quot;&gt;
    &lt;li&gt;what if ImageListener is already defined to extend some other class? CFCs only support single inheritance, so ImageListener can&apos;t extend both DirectoryListener and some other class; this approach is simply more restrictive than necessary; and,

    &lt;li&gt;ImageListener doesn&apos;t actually inherit any behavior (functions) or state (variables) from DirectoryListener, so forcing ImageListener to extend DirectoryListener is really a misuse of subclassing.
    &lt;/ol&gt;

&lt;li&gt;Use Duck Typing by changing the second CFARGUMENT of the DirectoryWatcher addListener function to TYPE=&quot;ANY&quot;, and provide documentation that tells you what functions the event listeners need to implement. This could work, but I prefer the interface-based solution:
  &lt;ol type=&quot;a&quot;&gt;
  &lt;li&gt;I like for my CFCs and their functions to be self-documenting; what does TYPE=&quot;ANY&quot; in a CFARGUMENT tag tell me? It tells me a lie, really, because in fact it doesn&apos;t expect &quot;ANY&quot; argument, it very specifically expects a CFC that implements the onAdd, onChange, and onDelete functions, and my code won&apos;t work properly if I give it anything else.

  &lt;li&gt;I like to have the contracts between my objects enforced as much as possible and as soon as possible by the compiler and runtime. By using interfaces, I&apos;ll get an error as soon as I try to pass a CFC that doesn&apos;t implement the required functions; by using Duck Typing I&apos;ll only get an error when I actually try to call one of the functions and it doesn&apos;t exist, if I get any error at all. (Here&apos;s an example: imagine I mistype my Application.cfc &quot;onRequestStart&quot; function to be &quot;onReqeustStart&quot;? If Application.cfc had been implemented with interfaces, I&apos;d get an error right away that the onRequestStart function must be implemented; as it stands now, with Duck Typing, all I&apos;ll know is that my onRequestStart function isn&apos;t getting called, and now I&apos;m off digging trying to figure out why).
  &lt;/ol&gt;
&lt;/ol&gt;

This is a very simple example of the usefulness of CFC Interfaces when implementing the Observer/Event Listener design pattern (which you&apos;ll want to do whenever you implement asynchronous gateway-type features using CFTHREAD). I&apos;m going to follow-up with a detailed look at the DirectoryWatcher example, focusing on its use of CFTHREAD. Then I&apos;ll see if I can follow-up with some more detailed interface examples, and a few examples for Abstract CFCs (here&apos;s a hint: nearly all of the design patterns in the books referenced above are based on interfaces or abstract classes, or both; Singleton is the only pattern I can find that doesn&apos;t require either).
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>BlueDragon</category>				
				
				<pubDate>Fri, 27 Oct 2006 17:27:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm/2006/10/27/Interfaces-in-Action-the-ObserverEvent-Listener-Design-Pattern</guid>
				
				<enclosure url="http://blog.newatlanta.com/enclosures/BlueDragon_70_DirectoryWatcher.zip" length="6770" type=""/>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Interfaces and Abstract CFCs in BlueDragon 7.0</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=153E8968-1259-8AD9-6C7714F427BA183D</link>
				<description>
				
				With all of the discussion lately about interfaces and whether they should or shouldn&apos;t be included in CFML, no one&apos;s ever really described what interfaces are or how they&apos;re used. The discussion has all been theoretical. Worse, no one&apos;s talked at all about abstract CFCs, which are just as important as--or maybe even more important than--interfaces when doing object-oriented programming.

I thought I&apos;d remedy this situation by starting with a description of interfaces and abstract CFCs as implemented in BlueDragon 7.0, and then following with a series of blog entries that demonstrate practical uses of these concepts in developing real, useful CFML programs.

First, I must stress three things about these new features in BlueDragon 7.0: (1) their use is completely optional; if you don&apos;t understand them or don&apos;t think they&apos;re useful to you, then you don&apos;t have to use them; (2) they don&apos;t take away any of the dynamic programming features that exist in CFML; they don&apos;t &quot;limit&quot; or &quot;restrict&quot; you in any way; and, (3) they&apos;re completely backwards-compatible; any CFC code that runs today on CFMX or earlier versions of BlueDragon will continue to run unmodified on BlueDragon 7.0.

The following is taken from the &lt;a href=&apos;http://www.newatlanta.com/products/bluedragon/self_help/docs/7_0/BlueDragon_70_Whats_New.pdf&apos; target=&apos;_blank&apos;&gt;What&apos;s New in BlueDragon 7.0&lt;/a&gt; document:

Interfaces and abstract classes are common and useful features of most object-oriented programming languages such as C++, Java, and C#. BlueDragon 7.0 introduces these features for CFCs. If you’re familiar with these concepts, then their implementation in BlueDragon 7.0 should be straightforward and easy to understand.

If the concepts of interfaces and abstract classes are new to you, it helps to begin by understanding abstract functions. An abstract function is a function that does not (and cannot) implement a function body. In BlueDragon 7.0, a function can be declared to be abstract using the new TYPE attribute of the CFFUNCTION tag:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cffunction name=&quot;myAbstractFunction&quot; &lt;font color=&quot;red&quot;&gt;&lt;b&gt;type=&quot;abstract&quot;&lt;/b&gt;&lt;/font&gt;/&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

Abstract functions can only be declared within CFCs; that is, you cannot declare abstract user-defined functions within CFML pages. The body of an abstract function may only contain CFARGUMENT tags; if it contains any other tags an exception is thrown.

A CFC that contains one or more abstract functions must be declared to be abstract using the new TYPE attribute of the CFCOMPONENT tag (an &quot;abstract CFC&quot;):

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent &lt;font color=&quot;red&quot;&gt;&lt;b&gt;type=&quot;abstract&quot;&lt;/b&gt;&lt;/font&gt;&gt;
    &amp;lt;cffunction name=&quot;myConcreteFunction&quot;&gt;
        &amp;lt;cfreturn &quot;I have an implementation, so I&apos;m concrete&quot;/&gt;
    &amp;lt;/cffunction&gt;
    &amp;lt;cffunction name=&quot;myAbstractFunction&quot; type=&quot;abstract&quot;/&gt;
    ...
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

You may not create an instance of an abstract CFC using CFOBJECT, CreateObject, or CFINVOKE. Abstract CFCs may only be used as base classes for other CFCs (that is, other CFCs may extend abstract CFCs). If a CFC extends an abstract CFC, the subclass CFC must implement all of the abstract functions declared by the abstract superclass CFC, or the subclass CFC must itself be decared abstract.

If a CFC contains only abstract functions, it may be declared to be an interface using the new TYPE attribute of the CFCOMPONENT tag (an &quot;interface CFC&quot;, or just &quot;interface&quot;):

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent &lt;font color=&quot;red&quot;&gt;&lt;b&gt;type=&quot;interface&quot;&lt;/b&gt;&lt;/font&gt;&gt;
    &amp;lt;cffunction name=&quot;abstractFunctionOne&quot; type=&quot;abstract&quot;/&gt;
    &amp;lt;cffunction name=&quot;abstractFunctionTwo&quot; type=&quot;abstract&quot;/&gt;
    &amp;lt;cffunction name=&quot;abstractFunctionThree&quot;/&gt;
    ...
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

Because an interface CFC may only contain abstract functions, you can omit the type=&quot;abstract&quot; declaration for its CFFUNCTION tags. Like abstract CFCs, you cannot create an instance of an interface CFC.

An interface CFC may extend another interface CFC, but may not extend an abstract CFC or concrete (&quot;regular&quot;) CFC.

CFCs may declare that they implement one or more interface CFCs using the new IMPLEMENTS attribute of the CFCOMPONENT tag. A CFC may implement multiple interfaces by declaring them as a comma-separated list:

&lt;blockquote&gt;&lt;pre&gt;&amp;lt;cfcomponent &lt;font color=&quot;red&quot;&gt;&lt;b&gt;implements=&quot;interfaceOne, interfaceTwo&quot;&lt;/b&gt;&lt;/font&gt;
        extends=&quot;mySuperClass&quot;&gt;
    ...
&amp;lt;/cfcomponent&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

A CFC must implement all of the abstract functions declared by all of the interfaces declared in its IMPLEMENTS attribute.

An abstract CFC or interface CFC may be specified as the TYPE attribute for CFARGUMENT, or RETURNTYPE attribute for CFFUNCTION.
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>BlueDragon</category>				
				
				<pubDate>Mon, 23 Oct 2006 14:14:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=153E8968-1259-8AD9-6C7714F427BA183D</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Query caching with CFQUERYPARAM and CFSTOREDPROC</title>
				<link>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=12B9EA4E-C623-101A-C81BD7343E886A01</link>
				<description>
				
				Most CFML developers are aware that you can&apos;t use query caching in CF5/MX with the CFQUERYPARAM or CFSTOREDPROC tags. You should be aware that these limitations don&apos;t exist with BlueDragon, so after you&apos;ve upgraded to to either the Java/J2EE or .NET editions of BlueDragon you&apos;re free to use query caching with these tags.

&lt;b&gt;CORRECTION:&lt;/b&gt; query caching &lt;b&gt;does not&lt;/b&gt; work with CFSTOREDPROC, but it does work with CFQUERYPARAM within CFQUERY.
				
				</description>
						
				
				<category>CFML</category>				
				
				<category>BlueDragon</category>				
				
				<pubDate>Mon, 11 Sep 2006 11:44:00 -0400</pubDate>
				<guid>http://blog.newatlanta.com/index.cfm?mode=entry&amp;entry=12B9EA4E-C623-101A-C81BD7343E886A01</guid>
				
			</item>
			
		 	
			</channel></rss>