Article

Home » Server-side Coding » ColdFusion Tutorials » ColdFusion 8: Believe The Hype

About the Author

Brian Rinaldi

Brian Rinaldi Brian Rinaldi is an applications developer in Boston, MA. He is the manager of the Boston ColdFusion User Group and organizer of Flex Camp Boston. He is an Advanced Certified ColdFusion MX Developer, as well as a Microsoft Certified Professional. Brian is most well known for his efforts promoting open source projects in ColdFusion, especially for maintaining the ColdFusion open source list as well as the weekly updates, both of which you can find via his web site, remotesynthesis.com.

View all articles by Brian Rinaldi...

ColdFusion 8: Believe The Hype

By Brian Rinaldi

February 22nd, 2008

Reader Rating: 9

Page: 1 2 Next

Rather than succumb to the many premature rumors of its impending demise, ColdFusion continues to thrive, even more so under the auspices of its new owner, Adobe. With the release of ColdFusion 8, Adobe has reaffirmed its commitment to ColdFusion by releasing the most feature-rich version in years.

Whether you've never used ColdFusion before, you're considering coming back to the fold, or you're looking for a good reason to upgrade, ColdFusion 8 definitely deserves your consideration. Indeed, ColdFusion 8 represents a major release, with more new features than I could possibly cover in a single article. In short, now is a very good time to be a ColdFusion developer, and in this article we'll look at my favorite reasons why.

Speed Improvements

What's that you say? Speed is not a feature? Well, when the improvement is as dramatic as it is in ColdFusion 8, it can definitely be considered a feature. The ColdFusion team analyzed over 100 actual customer applications to find and eliminate bottlenecks. This resulted in an overall improvement that makes the server up to 4.25 times faster than ColdFusion 7.0.2. In fact, some specific areas and tags are 39 times faster than prior versions. In particular, if you're undertaking object-oriented development using ColdFusion components (CFC), you'll notice a marked improvement.

The best part is that you don't need to do anything to take advantage of this feature other than install ColdFusion 8. Without changing a single line of code, your existing ColdFusion application will see a huge performance boost. So, here's the plan...

  1. Sell your boss on a plan to dramatically improve site performance, budgeting four weeks of work.

  2. Buy and install ColdFusion 8.

  3. Spend four weeks improving your ranking on World of Warcraft.

If you aren't already developing with ColdFusion, it's important to keep in mind that ColdFusion has long since outgrown the accusations of being slow or unscalable. As a developer at The Economist who recently upgraded to ColdFusion 8 noted, "...the whole thing is ridiculously stable."

Server Monitor

Sometimes, when diagnosing application performance issues in previous versions of ColdFusion, it felt like you were a doctor trying to diagnose an internal injury without access to an x-ray machine. You knew something was generally wrong inside, but you had no way of seeing (and therefore, of treating) the issue. Well, the good news is that ColdFusion 8 (Enterprise and Developer versions) comes with an x-ray machine ... er ... a server monitor that allows you to peer at the internals of your ColdFusion server on which you're running your application.

The ColdFusion Server Monitor is a Flex application that allows you to examine a variety of statistics related to the overall health of your server. It provides you with details about specific applications, sessions, requests, and queries. For example, you can get reports on slow requests, and drill-down into those requests to see variable memory usage for each request, as well as the performance of any includes, custom tags, and components within the request. This can help immensely when you're trying to locate bottlenecks within a slow request. In my opinion, this feature alone will have a huge impact on how developers will build and debug ColdFusion applications going forward.

In addition, the Server Monitor offers customizable alerts that allow you to receive notification when certain undesirable behaviors occur, such as low JVM memory or excessively long-running threads. You can even customize the response that the Server Monitor implements when this behavior occurs, configuring it either to send an email, create a snapshot, kill threads running longer than a specific timeframe, or even execute a set of custom code from within a ColdFusion component that you specify.

Ajax Integration

With the release of version 7.0.2, ColdFusion added Flex integration, which made it the language of choice for building Rich Internet Applications (RIAs) using Adobe's Flex. This was great for those of us who love Flex (as I do!). However, building RIAs with Ajax required the integration third-party open-source libraries if you wanted to work natively with ColdFusion data types and JavaScript. It also meant that you had to include and learn the syntax of one or more external JavaScript libraries like Ext, Spry or the Yahoo User Interface library (YUI). With ColdFusion 8, this is no longer the case.

ColdFusion 8 has added a long list of new tags and features that have been designed specifically to allow you to rapidly build Ajax-based Rich Internet Applications using a comfortable and familiar tag and function syntax. In fact, the libraries that I mentioned above are built into ColdFusion 8, making it possible, for example, to create an Ajax grid using Ext simply by using the cfgrid tag. You can even bind this grid to a dataset that's returned by a CFC method simply by putting a reference to the cffunction into the bind attribute of the tag. ColdFusion 8 really does make it incredibly simple and intuitive to add some glitz to your application by integrating rich user interface elements.

Even better, in my opinion, is that the Ajax integration in ColdFusion 8 goes much deeper than simply adding fancy UI elements to your application. ColdFusion added tags and functions that allow you to easily move data back and forth between JavaScript. For example, with the cfajaxproxy tag you can make functions that reside within a CFC callable directly from your page, using JavaScript. This feature will even automatically convert data types (such as a ColdFusion query object) into a type that's usable within your JavaScript block, such as an array or as JSON packets. The created proxy also contains built-in methods for setting a callback handler for the asynchronous method calls. All of this makes working with Ajax and ColdFusion feel completely seamless.

The following example code shows how the cfajaxproxy tag can be used to create a class based upon a component that can be used within JavaScript:

<cfajaxproxy cfc="path.to.cfc" jsclassname="MyClass" />  
<script>
   function myFunction(id) {
       var myClass = new MyClass();
       myClass.setCallbackHandler(populateWindow);
       myClass.getSomeData(id);
   }
   function populateWindow {
       // this function can be used, for example, to populate the returned data into a javascript window generated with the cfwindow tag
   }
</script>

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links