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




Who Should Use This Book

How to Use This Book

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 to create 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 Macromedia ColdFusion MX, 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 a complete tutorial of everything you need to know to harness ColdFusion's power. As such, the book is divided into four sections, each of which 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. The reference chapters are cross-referenced to the appropriate tutorial sections, so that step-by-step information is always readily available.


Now in its sixth 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 ColdFusion MX Application Development (Macromedia Press, ISBN: 0-321-12710-2).

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, and everything else you need to know to get up and running quickly.

In Chapter 1, “Introducing ColdFusion,” the core technologies upon which ColdFusion is built 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 its various components.

Chapter 2, “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 the pros and cons of each.

Chapter 3, “Accessing the ColdFusion Administrator,” introduces the ColdFusion Administrator. 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 code generation, and manually, too.

In Chapter 5, “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 the technology and walks you through the process of creating data sources. This chapter also teaches you how to use the SQL SELECT statement.

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

Chapter 7, “Introducing Macromedia Dreamweaver MX,” introduces this brand-new ColdFusion development environment. Dreamweaver MX 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, and how to configure the environment to work the way you do.

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 they 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 that ColdFusion developers use regularly is explained here, 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 the use of tables and lists, are taught as well. One method of displaying data on the Web is data drill-down (which has become very popular); this approach to data interaction is also taught.

In Chapter 11, “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 infinite 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 12, “Form Data Validation,” explains the various techniques and options available for data validation. ColdFusion can generate JavaScript client-side validation code automatically, without your having to learn JavaScript. You learn how to use this feature and how to provide your own validation rules.

Chapter 13, “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.

Chapter 14, “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 concentrates 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 15, “Planning an Application,” teaches important design and planning techniques you can leverage within your own development.

In Chapter 16, “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 application-wide settings and options and how to use the APPLICATION scope.

Chapter 17, “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 18, “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 19, “Building User-Defined Functions, ” introduces the <CFFUNCTION> tag and explains how it can (and should) be used to extend the CFML language.

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

Chapter 21, “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 out a bit more performance wherever possible. Chapter 22, “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 23, “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.

In Chapter 24, “Enhancing Forms with Client-Side Java,” you learn how to take advantage of the ColdFusion-supplied Java form controls. These controls include a Windows Explorer–style tree control, an editable grid control, a slider control, and a highly configurable text-input control. You also learn how to embed your own Java applets using the <CFAPPLET> tag.

Chapter 25, “Graphing,” introduces ColdFusion's new high-performance graphing engine. You learn how to use the <CFCHART> tag (and related child tags) to create all sorts of business graphics (including bar charts, pie charts, and more) for use within your applications.

Chapter 26, “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 27, “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.

Chapter 28, “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 29, “More on SQL and Queries,” teaches you how to create powerful SQL statements using subqueries, joins, unions, 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 30, “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 31, “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 they can be used as part of a complete error-handling strategy.

ColdFusion is used primarily to generate Web content, but that is not all it can do. In Chapter 32, “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 33, “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 34, “Full-Text Searching,” introduces the Verity search engine. Verity provides a mechanism that performs full-text searches against all types of data. The Verity engines (yes, there are two of them) are bundled with the ColdFusion Application Server, and the <CFINDEX> and <CFSEARCH> tags provide full access to Verity indexes from within your applications.

Chapter 35, “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 36, “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 37, “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 walks you through the entire process of installing Macromedia ColdFusion MX and Macromedia Dreamweaver MX. Various installation options are explained, as is the installation of ColdFusion MX on top of J2EE servers. The sample applications used in this book are also installed here.

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 Directory Structure,” explains the directories and files that make up ColdFusion MX, 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

  • Evaluation and developer editions of ColdFusion MX

  • Evaluation edition of Macromedia Dreamweaver MX

  • Evaluation edition of Macromedia Flash MX

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

  • Electronic versions of some chapters

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

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