Preface
Adobe ColdFusion is an application server, renowned for rapid development of dynamic websites, with a straightforward language (CFML), powerful methods for packaging and reusing your code, and AJAX support that will get developers deep into powerful web applications quickly. However, developing rich and robust web applications can be a real challenge as it involves multiple processes.
With this practical guide, you will learn how to build professional ColdFusion applications. Packed with example code, and written in a friendly, easy-to-read style, this book is just what you need if you are serious about ColdFusion.
This book will give you a clear, concise, and, of course, practical guidance to take you from the basics of ColdFusion 9 to the skills that will make you a ColdFusion developer to be reckoned with.
ColdFusion expert John Farrar will teach you the basics of ColdFusion programming, basic application architecture, object reuse, and ORM concepts before showing you a range of topics including AJAX library integration, RESTful Web Services, Unit Testing, building custom tags, and his hybrid example of tags and objects COOP. All these together will make you the toast of your ColdFusion developer town.
This book digs deep into the basics, with real-world examples of the hows and whys, to get more done faster with ColdFusion 9.
This book's website (http://www.sosensible.com/index.cfm/books/) also covers the new features of ColdFusion Builder and additional version 9 updates.
What this book covers
Chapter 1, Web Pages—Static to Dynamic is a fast track introduction to what makes CF better than HTML and how to program with CFML.
Chapter 2, Basic CFCs and Database Interaction which makes our code easier to support is done by packaging logic into reusable containers. This chapter will introduce you to CFML-based object coding.
Chapter 3, Power CFCs and Web Forms is a chapter that shows the power you can achieve by packaging things into CFCs. Their features are faster coding, easier support, and simpler to read code with a minor up-front investment.
Chapter 4, ORM Database Interaction talks about the Object Relation Management (ORM) standard in CF9. This is a built in object technology that works with your database without creating SQL specific to each database platform.
Chapter 5, Application, Session, and Request Scope is a chapter that teaches us how controlled sharing will speed up your application and make them easier to build and understand.
Chapter 6, Authentication and Permissions shows us how to manage who can and who cannot do things.
Chapter 7, CFScript in CF9 is the first fully-featured script for CFML. This chapter will help us get familiarized with script and shows how to enjoy its new completeness.
Chapter 8, CF AJAX User Interface covers the tag-based language in CFML that lets us interact with AJAX in ways we can only appreciate. This chapter covers the UI element features in ColdFusion.
Chapter 9, CF AJAX Forms covers how ColdFusion lets us build richer forms with the power of built-in tags.
Chapter 10, CF AJAX Programming will teach us how to work in the browser when we want to use JavaScript to interact with the code. This chapter covers the common interface and how to use it.
Chapter 11, Introduction to Custom Tags shows us how to take advantage of tag-based packaging and how to do it when we desire.
Chapter 12, ColdFusion Powered Views will introduce us to a view tag library that makes forms and view code easier and much simpler to support.
Chapter 13, Control Logic Processing shows us how to interact with the events and view elements from a request controller. This chapter helps us understand a methodology of coding that makes for a logical flow of code where things fit in smartly.
Chapter 14, Guide to Unit Testing covers a growing and very beneficial concept of software development and sustainability—unit testing.
Appendix A, Beyond this Book is based on some additional thoughts from the author. This is a tutorial book and it made sense for me to put in a chapter that shares thoughts about moving beyond the reach of a single book introduction to web development.
Appendix B, Tools and Resources lists some of the tools we use at my company and thoughts on each of them. The number of tools and resources has grown in volume to the point where half of this book would cover this topic alone.
What you need for this book
To follow along in the book, you will need to have a version of ColdFusion installed. Some of the database examples are running in MySQL. Refer to this book's site (http://www.sosensible.com/index.cfm/books/) for requests of your configuration and we will seek to accommodate finding links and resources to assist your configuration.
Who this book is for
This book is for two groups of developers: New and experienced ColdFusion users.
If you are a new user, you will find that the contents of the first seven chapters will give you a solid start to development on the platform. At the book's site previously mentioned, we will collect a resource link page to assist you with moving ahead with different topics based on having read this book.
If you are not new to ColdFusion, you will find that the content of the first seven chapters is both a meaningful review and also an introduction to some of the related changes on the basics that were added in version 9.
The last half of this book is about features that go beyond the basics. They are perhaps the most popular features that people desire to learn when working with ColdFusion 9. Additional features will of course be posted on the book's site. If there are features specific to ColdFusion 8, you will find many of those in the first version of this book—ColdFusion 8 Developer Tutorial. We have tried to mix up some of the additional coverage to make getting the newer version of this book more valuable of course.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "The exception is placed on the page using <cfdump>
".
A block of code is set as follows:
<!--- Example: 1_10.cfm ---> <!--- Processing ---> <!--- Content ---> <cfoutput> My name is #url.name#.<br /> </cfoutput>
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
<cffunction name="load" access="public" output="false"> <cfargument name="id" required="false" /> <cfscript> var myReturn = getRecordset(where : "id = #arguments.id#"); setAttributes(myReturn); </cfscript> <cfreturn myReturn /> </cffunction>
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Let us click the + New Product link, and observe what we get".
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book— what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <feedback@packtpub.com>
, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <suggest@packtpub.com>
.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Tip
Downloading the example code for this book
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <copyright@packtpub.com>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at <questions@packtpub.com>
if you are having a problem with any aspect of the book, and we will do our best to address it.