• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL




Who Should Use This Book xli

How to Use This Book xli

Who Should Use This Book

This book is written for anyone who wants to create cutting-edge Web-based applications.

If you are a Webmaster or Web page designer and want to create dynamic, data-driven Web pages, this book is for you. If you are an experienced database administrator who wants to take advantage of the Web to publish or collect data, this book is for you, too. If you are starting out creating your Web presence, but know you want to serve more than just static information, this book will help get you there. If you have used ColdFusion before and want to learn what's new in ColdFusion MX 7, this book is also for you. Even if you are an experienced ColdFusion user, this book provides you with invaluable tips and tricks and also serves as the definitive ColdFusion developer's reference.

This book teaches you how to create real-world applications that solve real-world problems. Along the way, you acquire all the skills you need to design, implement, test, and roll out world-class applications.

How to Use This Book

This book is designed to serve two different, but complementary, purposes.

First, it is the book used by most ColdFusion developers as a complete tutorial of everything you need to know to harness ColdFusion's power. As such, the book is divided into four sections, and each section introduces new topics, building on what has been discussed in prior sections. Ideally, you will work through these sections in order, starting with ColdFusion basics and then moving on to advanced topics.

Second, this book is an invaluable desktop reference tool. The appendixes and accompanying CD-ROM contain reference chapters that will be of use to you while developing ColdFusion applications. Those reference chapters are cross-referenced to the appropriate tutorial sections, so that step-by-step information is always readily available.


Now in its seventh major release, ColdFusion has matured into a massive application, and a single volume could not do justice to all its features. As such, this book is being released in conjunction with a second book: Advanced Macromedia ColdFusion MX 7 Application Development (Macromedia Press, ISBN: 0-321-29269-3).

Part I—Getting Started

Part I of this book introduces ColdFusion and explains what exactly it is that ColdFusion enables you to accomplish. Internet fundamentals are also introduced; a thorough understanding of these is a prerequisite to ColdFusion application development. This part also includes coverage of databases, SQL, Macromedia Dreamweaver MX 2004, and everything else you need to know to get up and running quickly.

In Chapter 1, “Introducing ColdFusion,” the core technologies ColdFusion is built on are introduced. The Internet and how it works are explained, as are DNS servers and URLs, Web servers and browsers, HTML, and Web server extensions. A good understanding of these technologies is a vital part of creating Web-based applications. This chapter also teaches you how ColdFusion works and explains the various components that comprise it.

Chapter 2, “Introducing Macromedia Dreamweaver MX 2004,” introduces Dreamweaver as a ColdFusion development environment. Dreamweaver is a powerful HTML and CFML editor, as well as a mature and trusted page layout and design tool. You learn how to use the editor, how to work with sites, as well as how to configure the environment to work the way you do.

Chapter 3, “Accessing the ColdFusion Administrator,” introduces the ColdFusion Administrator program. This Web-based program, written in ColdFusion itself, manages and maintains every aspect of your ColdFusion Application Server.

To whet your appetite, Chapter 4, “Previewing ColdFusion,” walks you through creating two real, working applications using Macromedia Dreamweaver MX 2004 code generation and also manually.

Chapter 5, “Building the Databases,” provides a complete overview of databases and related terms. Databases are an integral part of almost every ColdFusion application, so database concepts and technologies must be well understood. Databases are mechanisms for storing and retrieving information, and almost every Web-based application you build will sit on top of a database of some kind. Key database concepts, such as tables, rows, columns, data types, keys, and indexes, are taught, as are the basics of the relational database model. You also learn the differences between client-server- and shared-file-based databases, as well as their pros and cons.

In Chapter 6, “Introducing SQL,” you learn the basics of the SQL language. SQL is a standard language for interacting with database applications, and all ColdFusion database manipulation is performed using SQL statements. The link between ColdFusion and your database itself is via database drivers, so this chapter introduces this technology and walks you through the process of creating data sources. This chapter also teaches you how to use the SQL SELECT statement.

Chapter 7, “SQL Data Manipulation,” introduces three other important SQL statements: INSERT, UPDATE, and DELETE.

Part II—Using ColdFusion

With the introductions taken care of, Part II quickly moves on to real development. Starting with language basics and progressing to database-driven applications and more, the chapters here will make you productive using ColdFusion faster than you thought possible.

Chapter 8, “Using ColdFusion,” introduces ColdFusion templates and explains how these are created and used. Variables are explained (including complex variable types, such as arrays and structures), as are CFML functions and the <cfset> and <cfoutput> tags.

Chapter 9, “CFML Basics,” teaches all the major CFML program flow language elements. From if statements (using <cfif>) to loops (using <cfloop>) to switch statements (using <cfswitch> and <cfcase>) to template reuse (using <cfinclude>), almost every tag used regularly by ColdFusion developers is explained here, and all with real, usable examples.

Chapter 10, “Creating Data-Driven Pages,” is where you create your first data-driven ColdFusion application, albeit a very simple one. You also learn how to use <cfquery> to create queries that extract live data from your databases and how to display query results using <cfoutput>. Various formatting techniques, including using tables and lists, are taught as well. One important method of displaying data on the Web is data drill down, and this approach to data interaction is also taught.

As applications grow in size and complexity, so does the need for structure and organizations. Chapter 11, “The Basics of Structured Development,” introduces ColdFusion Components, and explains how these should be used to build n-tier applications. Dreamweaver wizards and shortcuts for working with ColdFusion Components are explained as well.

In Chapter 12, “ColdFusion Forms,” you learn how to collect user-supplied data via HTML forms. This data can be used to build dynamic SQL statements that provide you with enormous flexibility in creating dynamic database queries. This chapter also teaches you how to create search screens that enable visitors to search on as many different fields as you allow.

Continuing with the topic of collecting data from users, Chapter 13, “Form Data Validation,” explains the various techniques and options available for data validation. ColdFusion can generate both client-side and server-side validation code automatically, and these features are explored in detail. You will learn how to use all of the various validation features offered by ColdFusion, as well as how to provide your own validation rules.

Chapter 14, “Using Forms to Add or Change Data,” teaches you how to use forms to add, update, and delete data in database tables. The ColdFusion tags <cfinsert> and <cfupdate> are introduced, and you learn how <cfquery> can be used to insert, update, and delete data.

HTML forms are useable for basic data-entry, but Web developers quickly find them restrictive and cumbersome to work with. Chapter 15, “Beyond HTML Forms, XForms and Flash,” introduces XForms (the standard for next generation forms) and Macromedia Flash alternatives to HTML forms, and shows how ColdFusion simplifies using both.

In Chapter 16, “Graphing, Printing, and Reporting,” you will learn how to generate business charts, printable Web pages (in both PDF and FlashPaper formats), as well as data-driven reports using the new ColdFusion Report Builder.

Chapter 17, “Debugging and Troubleshooting,” teaches you the types of things that can go wrong in ColdFusion application development and what you can do to rectify them. You learn how to use ColdFusion's debugging and logging features and how to trace your own code. Most importantly, you learn tips and techniques that can help you avoid problems in the first place.

Part III—Building ColdFusion Applications

Part II concentrated on ColdFusion coding. In Part III, all the ideas and concepts are brought together in the creation of complete applications.

Experienced developers know that it takes careful planning to write good code. Chapter 18, “Planning an Application,” teaches important design and planning techniques that you can leverage within your own development.

In Chapter 19, “Introducing the Web Application Framework,” you learn how to take advantage of the ColdFusion Web application framework to facilitate the use of persistent variables, sophisticated parameter and variable manipulation, and customized error message handling. You also learn how to use the application template to establish applicationwide settings and options and how to use the APPLICATION scope.

Chapter 20, “Working with Sessions,” teaches you all you need to know about CLIENT and SESSION variables, as well as HTTP cookies. These special data types play an important part in creating a complete application that can track a client's state.

Chapter 21, “Securing Your Applications,” introduces important security concepts and explains which you should worry about and why. You learn how to create login screens, access control, and more.

Chapter 22, “Building User-Defined Functions,” introduces the <cffunction> tag and explains how it can (and should) be used to extend the CFML language.

Chapter 23, “Building Reusable Components,” explains two other code reuse options; custom tags and ColdFusion Components. Both are extremely important application building blocks, and so you'll learn exactly what they are, when to use them, and how to do so.

Chapter 24, “Improving the User Experience,” helps you create applications that really get used. You learn important user interface concepts, how to build sophisticated browse screens, and much more.

Developers are always looking for ways to tweak their code, squeezing a bit more performance wherever possible. Chapter 25, “Improving Performance,” provides tips, tricks, and techniques you can use to create applications that will always be snappy and responsive.

Macromedia Flash is fast becoming the tool of choice for the creation of rich, highly interactive, portable, and lightweight user interfaces. Chapter 26, “Integrating with Macromedia Flash MX,” introduces Flash from a ColdFusion developer's perspective and explains how the two can be used together using new Flash remoting capabilities.

Chapter 27, “Interacting with Email,” introduces ColdFusion's email capabilities. ColdFusion enables you to create SMTP-based email messages using its <cfmail> tag. You learn how to send email messages containing user-submitted form fields, how to email the results of a database query, and how to do mass mailings to addresses derived from database tables. Additionally, you learn how to retrieve mail from POP mailboxes using the <CFPOP> tag.

Chapter 28, “Online Commerce,” teaches you how to perform real-time electronic commerce, including credit card authorization. You build an entire working shopping-cart application—one you can use as a stepping-stone when writing your own shopping applications.

Part IV—Advanced ColdFusion

Part IV teaches you advanced ColdFusion capabilities and techniques. The chapters in this section have been written with the assumption that you are familiar with basic SQL syntax and are very comfortable creating ColdFusion templates.


All of the chapters in this part are on the enclosed CD-ROM.

Chapter 29, “ColdFusion Server Configuration,” revisits the ColdFusion Administrator, this time explaining every option and feature, while providing tips, tricks, and hints you can use to tweak your ColdFusion server.

Chapter 30, “More on SQL and Queries,” teaches you how to create powerful SQL statements using subqueries, joins, unions, and scalar functions, and more. You also learn how to calculate averages, totals, and counts and how to use the EXISTS, NOT EXISTS, and DISTINCT keywords.

Chapter 31, “Working with Stored Procedures,” takes advanced SQL one step further by teaching you how to create stored procedures and how to integrate them into your ColdFusion applications.

Chapter 32, “Error Handling,” teaches you how to create applications that can both report errors and handle error conditions gracefully. You learn how to use the <cftry> and <cfcatch> tags (and their supporting tags) and how these can be used as part of a complete error-handling strategy.

ColdFusion is primarily used to generate Web content, but that is not all it can do. In Chapter 33, “Generating Non-HTML Content,” you learn how to use <cfcontent> to generate content for popular applications (such as Microsoft Word and Microsoft Excel), as well as mobile technologies such as WAP.

Chapter 34, “Interacting with the Operating System,” introduces the powerful and flexible Cold Fusion <cffile> and <cfdirectory> tags. You learn how to create, read, write, and append local files; manipulate directories; and even add file uploading features to your forms. You also learn how to spawn external applications when necessary.

Chapter 35, “Full-Text Searching,” introduces the Verity search engine. Verity provides a mechanism that performs full-text searches against all types of data. The Verity engine is bundled with the ColdFusion Application Server, and the <cfindex> and <cfsearch> tags provide full access to Verity indexes from within your applications.

Chapter 36, “Event Scheduling,” teaches you to create tasks that execute automatically and at timed intervals. You also learn how to dynamically generate static HTML pages using ColdFusion's scheduling technology.

In Chapter 37, “Managing Your Code,” you learn about coding standards, documentation, version control, and more, as well as why these are all so important.

Continuing with the topic of coding standards, Chapter 38, “Development Methodologies,” introduces several popular independent development methodologies designed specifically for ColdFusion development.

Part V—Appendixes

Appendix A, “Installing ColdFusion MX and Dreamweaver MX,” goes over system, hardware, and operating-system prerequisites and explains how to install both products. Installation of the sample applications used in this book is also explained.

Appendix B, “ColdFusion Tag Reference,” is an alphabetical listing of all CMFL tags and descriptions, complete with examples for each and extensive cross-referencing.

Appendix C, “ColdFusion Function Reference,” is a complete listing of every CFML function organized by category, complete with examples for each and extensive cross-referencing.

Appendix D, “Special ColdFusion Variables and Result Codes,” lists every special variable, prefix, and tag result code available within your applications.

Appendix E, “Verity Search Language Reference,” is a complete guide to the Verity search language. Using the information provided here, you will be able to perform incredibly complex searches with minimal effort.

Appendix F, “ColdFusion MX 7 Directory Structure,” explains the directories and files that make up ColdFusion MX 7, providing lots of useful tips and tricks in the process.

Appendix G, “Sample Application Data Files,” lists the format of the database tables used in the sample applications throughout this book.


The accompanying CD-ROM contains everything you need to start writing ColdFusion applications, including:

  • ColdFusion MX 7 (can be used as an Evaluation Version or as a Developer Edition).

  • Evaluation edition of Macromedia Dreamweaver MX 2004.

  • Evaluation edition of Macromedia Flash MX 2004.

  • Source code and databases for all the examples in this book

  • Electronic versions of all chapters in Part IV, Advanced ColdFusion.

Any versions of Coldfusion MX 7 not included on this CD-ROM can be found on the Macromedia Web site.

So turn the page and start reading. In no time, you'll be creating powerful applications powered by ColdFusion MX 7.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint