Understanding ColdFusion


Millions of Web sites exist that attract millions of visitors daily. Many Web sites are being used as electronic replacements for newspapers, magazines, brochures, and bulletin boards. The Web offers ways to enhance these publications using audio, images, animation, multimedia, and even virtual reality.

These sites add value to the Net because information is knowledge, and knowledge is power. All this information is literally at your fingertips. But because of the underlying technology that makes the Web tick, sites can be much more than electronic versions of paper publications. Users can interact with you and your company, collect and process mission-critical information in real time (allowing you to provide new levels of user support), and much more.

The Web isn't merely the electronic equivalent of a newspaper or magazineit's a communication medium limited only by the innovation and creativity of Web site designers.

The Dynamic Page Advantage

Dynamic pagespages that contain dynamic contentare what bring the Web to life. Linking your Web site to live data is a tremendous advantage, but the benefits of database interaction go beyond extending your site's capabilities.

To see why dynamic Web pages are becoming the norm, compare them to static pages:

  • Static Web pages. Static Web pages are made up of text, images, and HTML formatting tags. These pages are manually created and maintained so that when information changes, so must the page. This usually involves loading the page into an editor, making the changes, reformatting text if needed, and then saving the file. And not everyone in the organization can make these changes. The webmaster or Web design team is responsible for maintaining the site and implementing all changes and enhancements. This often means that by the time information finally makes it onto the Web site, it's out of date.

  • Dynamic Web pages. Dynamic Web pages contain very little text. Instead, they pull needed information from other applications. Dynamic Web pages communicate with databases to extract employee directory information, spreadsheets to display accounting figures, client-server database management systems to interact with order processing applications, and more. A database already exists. Why re-create it for Web page publication?

Creating dynamic pages lets you create powerful applications that can include features such as these:

  • Querying existing database applications for data

  • Creating dynamic queries, facilitating more flexible data retrieval

  • Executing stored procedures (in databases that support them)

  • Executing conditional code on the fly to customize responses for specific situations

  • Enhancing the standard HTML form capabilities with data validation functions

  • Dynamically populating form elements

  • Customizing the display of dates, times, and currency values with formatting functions

  • Using wizards to ease the creation of data entry and data drill-down applications

  • Creating printable content

  • Generating email automatically (in response to form submissions, for example)

  • Data-driven reports in FlashPaper and PDF formats

  • Shopping carts and e-commerce sites

  • Data syndication and affiliate programs

Understanding Web Applications

As we saw earlier, Web servers do just that: they serve. Web browsers make requests, and Web servers fulfill those requeststhey serve up the requested information to the browser. These are usually HTML files, as well as the other file types discussed previously.

And that's really all Web servers do. In the grand scheme of things, Web servers are actually pretty simple applicationsthey sit and wait for requests that they attempt to fulfill as soon as they arrive. Web servers don't let you interact with a database; they don't let you personalize Web pages; they don't let you process the results of a user's form submission. They do none of that; all they do is serve pages.

So how do you extend your Web server to do all the things listed above? That's where Web application servers come into play. A Web application server is a piece of software that extends the Web server, enabling it to do things it can't do by itselfkind of like teaching an old dog new tricks.

Here's how it all works. When a Web server receives a request from a Web browser, it looks at that request to determine whether it is a simple Web page or a page that needs processing by a Web application server. It does this by looking at the MIME type (or file extension). If the MIME type indicates that the file is a simple Web page (for example, it has an HTM extension), the Web server fulfills the request and sends the file to the requesting browser as is. But if the MIME type indicates that the requested file is a page that needs processing by a Web application server (for example, it has a CFM extension), the Web server passes it to the appropriate Web application server and returns the results it gets back rather than the actual page itself. Figure 1.6 illustrates this concept (in contrast to simple HTTP processing seen previously in Figure 1.4).

Figure 1.6. Web servers pass requests to Web application servers, which in turn pass results back to the Web server for transmission to the requesting browser.


In other words, Web application servers are page preprocessors. They process the requested page before it's sent back to the client (the browser), and in doing so they open the door to developers to do all sorts of interesting things on the server, such as:

  • Creating guest books

  • Conducting surveys

  • Changing your pages on the fly based on date, time, first visit, and whatever else you can think of

  • Personalizing pages for your visitors

  • In fact, all the features listed previously

What Is ColdFusion?

Initially, developing highly interactive and data-rich sites was a difficult process. Writing custom Web-based applications was a job for experienced programmers only. A good working knowledge of Unix was a prerequisite, and experience with traditional development or scripting languages was a must.

But all that has changed. Macromedia's ColdFusion enables you to create sites every bit as powerful and capable, without a long and painful learning curve. In fact, rather than being painful, the process is actually fun!

So, what exactly is ColdFusion? Simply put, ColdFusion is an application serverone of the very best out there, as well as the very first. (ColdFusion actually created the application server category back in 1995).

ColdFusion doesn't require coding using traditional programming languages, although traditional programming constructs and techniques are fully supported. Instead, you create applications by extending your standard HTML files with high-level formatting functions, conditional operators, and database commands. These commands are instructions to the ColdFusion processor and form the blocks on which to build industrial-strength applications.

Creating Web applications this way has significant advantages over conventional application development:

  • ColdFusion applications can be developed rapidly because no coding is required, other than use of simple HTML style tags.

  • ColdFusion applications are easy to test and roll out.

  • The ColdFusion language contains all the processing and formatting functions you'll need (and the capability to create your own functions if you run into a dead end).

  • ColdFusion applications are easy to maintain because no compilation or linking step is required. (Files actually are compiled, but that happens transparently, as I'll explain shortly). The files you create are the files used by ColdFusion.

  • ColdFusion provides all the tools you need to troubleshoot and debug applications, including a powerful development environment and debugger.

  • ColdFusion comes with all the hooks necessary to link to almost any database application and any other external system.

  • ColdFusion is fast, thanks to its scalable, multithreaded, service-based architecture.

  • ColdFusion is built on industry-standard Java architecture, and supports all major standards and initiatives.

ColdFusion and Your Intranet, Extranet, and Portal

Although we've been discussing Internet sites, the benefits of ColdFusion apply to intranets, extranets, and portals too.

Most companies have masses of information stored in various systems. Users often don't know what information is available or even how to access it.

ColdFusion bridges the gap between existing and legacy applications and your employees. It gives employees the tools to work more efficiently.



Macromedia Coldfusion MX 7 Web Application Construction Kit
Macromedia Coldfusion MX 7 Web Application Construction Kit
ISBN: 321223675
EAN: N/A
Year: 2006
Pages: 282

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net