Skip to main content
Top

2010 | Book

Adobe ColdFusion Anthology

Clear and Concise Concepts from the Fusion Authority

insite
SEARCH

About this book

Adobe ColdFusion remains one of today’s significant Web services tools and frameworks, and stands to become even more important as a possible primary tool for cloud development as well. As important as ColdFusion is and continues to become, we thought it would be a good idea to tap the leading authority on ColdFusion, the Fusion Authority. We asked this community to compile the most important issues in their developer and user experiences into one single volume—an anthology of the most current technical articles published in the Fusion Authority Quarterly Update.

In it, you’ll get the following:

The best and brightest ColdFusion expertise available today, from inside and outside of Adobe The most up-to-date content with the latest releases of ColdFusion Case studies and instances where ColdFusion is used in cloud-based development

Rather than take a soup-to-nuts approach that covers every single topic, including those that most people have learned already, this book takes specific items of interest and explains them so that you can hit the ground running, rather than having to wait until you’ve read the entire book.

Table of Contents

Frontmatter

ColdFusion Fundamentals

Frontmatter
Chapter 1. Working with Application.cfc

Application.cfc, introduced in ColdFusion MX 7, revolutionized ColdFusion programming because it allowed for a more modular, ColdFusion Component (CFC)-based approach to application management. Although some people still use Application.cfm, Application.cfc is the preferred method, and with good reason. Raymond Camden sheds some light on what’s possible using Applicationc.cfc.

Raymond Camden
Chapter 2. Application.cfc Reference

This visual aid and reference to the

Application.cfc

gives you the order of operation as well as the methods that are available in an

Application.cfc

template.

Michael Dinowitz
Chapter 3. From User-Defined Functions to ColdFusion Components

ColdFusion Components (CFCs) and user-defined functions (UDFs) have become the cornerstones of ColdFusion applications. It is almost impossible to use many of the latest capabilities of ColdFusion without knowing how to use UDFs and CFCs. In this chapter, Michael Dinowitz introduces you, step by step, to these cornerstones.

Michael Dinowitz
Chapter 4. onMissingTemplate()—Error Handler and So Much More

No matter how good your code is, it will fail. The question is how to minimize the effect of that failure and recover from it. ColdFusion provides many levels of code error handling ranging from cftry/cfcatch blocks all the way up to a site-wide error handler. This is great if the error is code based, but what if the error is due to a missing template? Coldfusion 8 has answered that question by introducing onMissingTemplate(), and in this article Michael Dinowitz examines missing templates and explains how this predefined method works.

Michael Dinowitz
Chapter 5. “Say What?” Handling Unknown Messages with onMissingMethod()

Among the new functions introduced in ColdFusion 8, onMissingMethod() is one of the more unappreciated ones. Most people see and use it as an error handler, if they use it at all. But the function really has so much more to offer. When it came to finding an author for this article, we didn’t have to go far. We didn’t have to go anywhere, actually. Sean Corfield eagerly volunteered before we could even ask him.

Sean Corfield

Document Creation in ColdFusion

Frontmatter
Chapter 6. PDF Support in ColdFusion

The PDF standard, created by Adobe, is a great way to keep documents consistent across digital and print media. When Adobe acquired Macromedia in 2005, we all hoped that sooner or later we’d have native PDF manipulation in ColdFusion. Version 8.0.1 brought us this ability with the

cfpdf

and related tags. ColdFusion 9 did not add any new PDF related tags, but it expanded the capabilities of the

cfpdf

tag family with some new actions, and it added the capability to create PDF packages or portfolios. In this article, updated by Michael Dinowitz, Raymond Camden takes us on a tour of the new PDF features in ColdFusion 8.01 and 9.

Raymond Camden
Chapter 7. Image Processing in ColdFusion

Built-in image resizing functionality has been on the ColdFusion developer’s wish list for years, and boy, has Adobe delivered! Not only did they give us the cfimage tag, with built-in image processing functionality, such as image resizing and getting the dimensions of an image, but they added advanced functionality with more than fifty additional image processing functions. In this article, Pete Freitag introduces you to the

cfimage

tag and several of ColdFusion’s image processing functions.

Pete Freitag

Essentials to Server Productivity

Frontmatter
Chapter 8. Tuning Your Java Virtual Machine: Finding Your Ideal JVM Settings Through Metrics Log Analysis

The Java Virtual Machine underlying the ColdFusion server is probably one of the least understood things about ColdFusion. Yet this mysterious “black box” is key to keeping ColdFusion operating efficiently. In the ColdFusion world, Mike Brunt is one of the best-known experts on taming this beast, and he presents many insights in this article.

Mike Brunt
Chapter 9. The Shoemaker and the Asynchronous Process Elves

This article was based on an experiment—a bit of impromptu testing by the author on the viability of using ColdFusion’s asynchronous processing, a feature introduced in ColdFusion MX 7. The effectiveness of the experiment and the power he discovered in asynchronous processing inspired and excited Doug and prompted this article.

Doug Boude
Chapter 10. Asynchronous Gateways Step-by-Step

Asynchronous gateways were one of the key additions to ColdFusion MX 7. Originally, gateways were limited to the Enterprise version, but in ColdFusion 8 and 9 this limitation has been removed. (ColdFusion 8 and 9 Professional allow gateways but limit the number of threads in use.) In this short article, a companion piece to Chapter 9, Doug Boude’s “The Shoemaker and the Asynchronous Process Elves,” Michael Dinowitz takes us, step-by-step, through setting up a gateway.

Michael Dinowitz
Chapter 11. You Might Have a Performance Bottleneck If...

Many a flame war has started over the argued performance of a web application based solely on the language with which it was programmed. You may hear “X scales better than Y,” or “No real programmer uses Z.” More often than not, poor performance in a web application can be traced to data management. The application could be performing tasks better suited to the database, or the database could be poorly designed. Taking a cue from Jeff Foxworthy’s “You might be a redneck i...” jokes, this article will introduce terms and concepts related to data normalization and application optimization in order to help you pinpoint poor database structures, data-storage processes, and data-retrieval techniques.

Adrian J. Moreno

Communication and Integrating with Other Technologies

Frontmatter
Chapter 12. An Introduction to Consuming and Deploying Web Services in ColdFusion

Web services are a primary means of transporting data from one place to another, from one application to another, across the Internet. ColdFusion makes web services easy to create and even easier to consume. This article steps you through Ben Nadel’s experimentation with web services.

Ben Nadel
Chapter 13. Web Services and Complex Types

ColdFusion is noted for being the great bridge between different technologies. This becomes quite clear when dealing with building web services, where developers must often send information between applications that use a wide variety of technologies. Building web services for consumption by other ColdFusion applications is simple, as it does many of the complex web development tasks: There is no need for special processing of input parameters or return values, for example, because ColdFusion can handle all of the data mappings behind the scenes. But what must be done to publish web services generated by other technologies or consumed by other programming languages, especially those that involve complex types? Nathan Mische tackles these cases and describes how you can make your web services truly accessible to all.

Nathan Mische
Chapter 14. Type Validation When Returning an Array of Components

This article was born out of an editorial question on Nathan Mische’s “Web Services and Complex Types,” which is Chapter 13 in this book. At the end of that article, Nathan tries to explain the concept of type validation when returning an array of components, which is a side issue of one of his code examples. It didn’t make sense to interrupt the flow of Nathan’s article to explain it clearly, but it is an important concept nonetheless. Michael agreed to write a companion piece that provides an explanation, and so this article was born.

Michael Dinowitz
Chapter 15. Sending E-mail the Right Way

As a means of communication, e-mail can be very effective. It’s cheaper and faster than the post office, and a well-written e-mail can grab the attention of your boss, customer, or client. There’s only one problem: Once you send that e-mail, how do you know it arrived at its destination? Mark Kruger has put together a fascinating tale of an e-mail and what it faces on the path from sender to recipient, with strategies to ensure that your e-mails will complete the journey.

Mark A. Kruger
Chapter 16. ColdFusion and Microsoft Exchange

In December 2005, Ben Forta posted a question on his blog: “What would you want from ColdFusion Microsoft Exchange integration?” People responded in droves. Putting the two products together makes a lot of sense. Both ColdFusion and Exchange are heavily used as part of many companies’ intranet solutions, so being able to leverage them at the same time would be extremely useful. There has always been a way to do it: kludge together some socket operation while creating a WebDAV request by hand. It’s neither fun nor easy, but eventually it works.

Terry Ryan
Chapter 17. BlazeDS

When Adobe introduced BlazeDS, a free, open source messaging system, there was a lot of buzz in the ColdFusion community—and some confusion. While eager to try the product, some ColdFusion developers did not understand its capabilities or the differences between BlazeDS and LiveCycle Data Services (LCDS), Adobe’s commercial messaging system. This article dispels any confusion you might have and presents BlazeDS as a free alternative to LCDS.

John Mason

Object-Oriented Programming (OOP)

Frontmatter
Chapter 18. Object-Oriented Programming: Why Bother?

Unless you’ve been living under a rock, you’ve heard about the increasing focus on object-oriented programming (OOP) in the ColdFusion world. With the advent of ColdFusion Components (CFCs) in ColdFusion MX 6, and the constant improvement to CFCs in every version of ColdFusion since, OOP has not only become possible for ColdFusion developers, but is rapidly becoming the de facto standard for building applications. Why is this? And if you haven’t drunk the OOP Kool-Aid yet, why should you care? In this article, I’ll start with a brief overview of the fundamentals of OOP. Then I will focus on some reasons for taking the time to learn about it.

Brian Kotek
Chapter 19. The Object-Oriented Lexicon

Learning object-oriented programming brings a whole slew of concepts and terminology that many ColdFusion developers are unprepared for. When we did the object-oriented and frameworks issue (Fusion Authority Quarterly Update Volume 1, Issue 2), I asked Hal Helms to write a lexicon as an easy reference. This was probably the hardest chapter in the whole book to write, and it caused great contention between members of our staff due to the differing philosophical opinions on various items.

Hal Helms
Chapter 20. Design Patterns: Exposing the Service Layer

Peter Bell is known in the community for his focus on meta programming, code generation and domain specific modeling. However this article is focused on application architecture — specifically some design considerations when creating a domain model that can be accessed by multiple view technologies such as HTML, AJAX and Flex.

Peter Bell
Chapter 21. Beans and DAOs and Gateways, Oh My!

When you decide to incorporate object-oriented programming and design patterns into your ColdFusion toolbox, the most confusing set of concepts is the whole notion of “beans and DAOs and gateways and services.” It seems like so much work just to do something that you used to do with a couple of tags — and everyone seems to have strong, and differing, opinions on how best to implement these concepts.

Sean Corfield
Chapter 22. SOA for the Rest of Us

Examples of service-oriented architecture (SOA) systems abound in this Web 2.0 world. Twitter is a perfect example. Twitter is both a web site and a service exposed as a web-accessible API. All sorts of clients allow users to interact with the Twitter service without ever visiting the Twitter web site. A variety of mashups also extend Twitter—linking photos, offering search capabilities, and even posting geographic info to tweets.

Dave Konopka
Chapter 23. How Base Classes Can Help You Generate Your Applications

Base classes don’t just make your applications leaner and quicker to develop. They can also be a great first step toward generating more of your code. This article examines what base classes are, why you should care, and how they can be used as a starting point when generating code for your applications.

Peter Bell

ColdFusion Frameworks

Frontmatter
Chapter 24. An Introduction to Frameworks

Within minutes of the first ColdFusion framework (Fusebox) being announced on CF-Talk, questions arose: Why bother? What do we need a framework for? Isn’t it just more work? The questions have not been resolved, despite the fact that Fusebox is now in its fifth iteration. So we asked Jared Rypka-Hauer to take on frameworks—explain what they are and why they are useful, and delve into the differences among the many frameworks available to the ColdFusion community.

Jared Rypka-Hauer
Chapter 25. Fusebox 5 Fundamentals

Fusebox 5.5 is the latest release of ColdFusion’s oldest and most popular application framework. This article introduces Fusebox. And for those who have been using Fusebox 4, 4.1, or 5, it covers what’s new in Fusebox 5.5.

Sean Corfield
Chapter 26. Mach-II Fundamentals

Mach-II was created in 2003 by Ben Edwards and Hal Helms. Originally, they thought this would be a new, CFC-centric branch of Fusebox, and they called it Fusebox MX. They changed the name to Mach-II when they realized that it was very different from Fusebox. Mach-II was the first truly object-oriented framework that was created for ColdFusion. In 2007, Ben Edwards and Hal Helms passed the torch to Peter Farrell, Matt Woodward, and Kurt Wiersma, who have been stewards of the framework ever since. The Mach-II web site has an active community of participants who help to guide the framework, and the motto “We’re community-driven” is something they stress greatly in their documentation. In this article, Matt Woodward gives a clear, comprehensive introduction to Mach-II, discusses where Mach-II fits in the CFML framework landscape, and demonstrates Mach-II in action through a few simple examples.

Matt Woodward
Chapter 27. Model-Glue Fundamentals

In the Model-Glue documentation, they lament that there is no book on Model-Glue. They say that the framework is so small that it wouldn’t fill a book. This article is our answer to that lack.

Joe Rinehart
Chapter 28. ColdSpring Fundamentals

The ColdSpring framework, originally developed by Chris Scott and Dave Ross, was created to help developers manage their components and any dependencies (objects or data that the components depend on). Modeled on Java’s popular Spring framework, ColdSpring has been widely accepted by objectoriented developers in the ColdFusion community—in two separate surveys of the community, about a third of the respondents said they use ColdSpring. All of the popular MVC frameworks support ColdSpring integration, including Model-Glue, Fusebox, Mach-II, and ColdBox. Indeed, Model-Glue uses ColdSpring internally to configure the framework itself. In this article, Chris Scott explains what ColdSpring does and how you might use it in your development.

Chris Scott
Chapter 29. Reactor Fundamentals

A few years ago, I was deep in the throes of crunch time. All programmers are familiar with this point in a project. This is where it sinks in that there really are only two weeks remaining to get all that work done. Luckily, we weren’t very far from our goal. One of the major reasons we weren’t in over our heads was that we were using a code generator to build (and rebuild) our database abstraction layer. This article looks at some of the advantages of using generated database abstraction layers, what Reactor is, and some basic examples of Reactor usage.

Doug Hughes
Chapter 30. Developing Applications with Transfer

First released in November 2005, Transfer is a ColdFusion object-relational mapping (ORM) framework that is still in use today. In fact, Mark Mandel, the creator of Transfer, is constantly updating the ORM, which is now on version 1.1. Sean Corfield has called Transfer “a very low overhead ORM, in terms of raw performance.” (

http://corfield.org/entry/The_Other_ORM

). In this article, Mark Mandel explains what an ORM framework is, how Transfer works, and how to get started with your Transfer application.

Mark Mandel
Chapter 31. FW/1: The Invisible Framework

Just when you thought we’d seen all possible frameworks in ColdFusion, Framework One (FW/1) comes along. In this article, Sean Corfield talks about this framework’s conception, a reponse to the increasing complexity of popular application frameworks, and its ease of implementation and use.

Sean Corfield

Designing the User Interface

Frontmatter
Chapter 32. Separating Layout from Logic

When architecting a web application, one of the hardest problems is cleanly separating presentation from programming. In this article, Peter Bell of Systems Forge looks at why this is a problem and then introduces three techniques that can help to make your code more maintainable by reducing duplication and more clearly separating presentation and programming concerns.

Peter Bell
Chapter 33. Creating Dynamic Presentations in ColdFusion

Presentations, love them or hate them, are a fact in most businesses. Being stuck in a primarily Microsoft office, my colleagues and I were usually forced to work with PowerPoint whenever the need for a presentation arose. PowerPoint is a good piece of software, but it has its limitations, especially if you want to present remotely. Sharing a PowerPoint presentation over the web has unique challenges and does not allow for a very interactive or engaging presentation.

Wally Kolcz
Chapter 34. Working with JSON and cfajaxproxy

Integrating Ajax with ColdFusion took a big leap forward with the introduction of two features: JSON (JavaScipt Object Notation) support and the addition of cfajaxproxy. In this article, Raymond Camden shows how JSON support and cfajaxproxy can make your Ajax ColdFusion development much easier.

Raymond Camden
Chapter 35. Prototyping for Interface Driven Architecture: Easing the Transition from Prototype to Application

Interface-Driven Architecture (IDA), as developed by Hal Helms and Clark Valberg, is the idea that one develops the interface design of the application before one actually builds the code for the backend. Having a client sign off on a clickable prototype should make planning the client’s application much simpler. Doug Boude relates his experience on a real-life project using IDA, and explains how some preplanning on aspects of the interface architecture would have made things simpler still.

Doug Boude

Development Tools

Frontmatter
Chapter 36. Turbo Charging Eclipse

Eclipse’s widespread use across multiple programming communities is perhaps partly due to its versatility and flexibility. Developers can customize their user interface with different views and can even add custom plug-ins for a highly personalized interface. However, Eclipse may need fine-tuning to be efficient and quick to respond. Mike Henke has experimented with different settings on his Eclipse installation to find the secrets to a faster, happier IDE. This article describes his recipe for a turbo-charged Eclipse.

Mike Henke
Chapter 37. An Introduction to ColdFusion Builder

If you haven’t heard, Adobe is working on an Integrated Development Environment (IDE) for ColdFusion. Old timers will remember ColdFusion Studio, released with early ColdFusion versions. But Macromedia stopped developing new features for ColdFusion Studio around ColdFusion 5. Some versions of Dreamweaver had features that made it a good ColdFusion editor, but more recent releases have not seen any new ColdFusion features other than updated syntax dictionaries. The continued lack of developer support from Adobe has caused many prominent ColdFusion developers to ask for a fully supported ColdFusion development environment. Adobe heard the message and answered with ColdFusion Builder, based on the Eclipse development platform.

Jacob Munson
Chapter 38. The ColdFusion Debugger Explained: Interactive Step Debugging for ColdFusion 8 and 9

Charlie Arehart has long been known for his support of debuggers and monitors for ColdFusion when they were available only through third-party vendors. Now that Adobe has created a debugger for ColdFusion 8 and 9, who else would we get to cover it but Charlie?

Charlie Arehart
Chapter 39. Getting Started with Subversion

When I first decided to commission a three-part Subversion series for Fusion Authority Quarterly Update, Volume 2, Issue 4, my aim was to fill a gap in documentation that existed at the time. The ColdFusion community was becoming more interested in source control at the time, but the documentation for Subversion was slim and not very well written. Jim Pickering’s introduction to Subversion was one of the clearest I have come across, and it is better than most documentation I have read since. He has updated and expanded his article for this anthology.

Jim Pickering
Chapter 40. Subversion in the Workflow

Using source control isn’t just learning the software; it’s acquiring work habits that may feel foreign to you or to your company. Making changes in how you work can seem threatening, but making the right changes can bring a wonderful boost of productivity to a company. In this part of our Subversion trilogy, Boyan Kostadinov tackles the question of how to incorporate Subversion into your company’s workflow.

Boyan Kostadinov
Chapter 41. Advanced Subversion

This article is the final piece in our Subversion trilogy, adding content beyond the standard introduction to Subversion. You’ve set up your Subversion server and you’re up and running (Chapter 39, “Getting Started with Subversion”). You’ve integrated Subversion into your workflow (Chapter 40, “Subversion in the Workflow”). Well, where do you go from here? What does Subversion offer for the more experienced user? Kevin Jones gives us the benefit of his extensive experience.

Kevin Jones
Chapter 42. Automating Your Development with Ant

Any complex task, such as making an important update or upgrade live, or doing some complex testing on an application, becomes easier and more organized with automation software such as Ant. This program has become extremely popular in many programming communities, and ColdFusion is no exception. In this article, Jim Priest explains how to automate your development with Ant.

Jim Priest
Backmatter
Metadata
Title
Adobe ColdFusion Anthology
Authors
Dinowitz Michael
Judith Dinowitz
Copyright Year
2010
Publisher
Apress
Electronic ISBN
978-1-4302-7214-4
Print ISBN
978-1-4302-7215-1
DOI
https://doi.org/10.1007/978-1-4302-7214-4

Premium Partner