467 Adobe ColdFusion Anthology free download ebook

www.it-ebooks.info

THE EXPERT’S VOICE ® IN WEB DEVELOPMENT

Adobe
ColdFusion
Anthology
Clear and Concise Concepts from
the Fusion Authority

SOURCE CODE ONLINE

www.apress.com

Michael and Judith Dinowitz
Foreword by Ben Forta,
Director of Platform Evangelism,
Adobe Systems Inc.

US $39.99


this print for content only—size & color not accurate

7.5 x 9.25 spine = 1.03125" 544 page count

www.it-ebooks.info

www.it-ebooks.info

Adobe ColdFusion
Anthology
Clear and Concise Concepts from
the Fusion Authority

■■■
Michael and Judith Dinowitz

www.it-ebooks.info

Adobe ColdFusion Anthology: Clear and Concise Concepts from the Fusion Authority
Copyright © 2010 by Michael and Judith Dinowitz

All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-4302-7215-1
ISBN-13 (electronic): 978-1-4302-7214-4
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every
occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of
the trademark owner, with no intention of infringement of the trademark.
President and Publisher: Paul Manning
Authors: Charlie Arehart, Peter Bell, Mike Brunt, Doug Boude, Raymond Camden, Sean Corfield,
Pete Freitag, Hal Helms, Mike Henke, Doug Hughes, Kevin Jones, Wally Kolcz, Dave Konopka,
Boyan Kostadinov, Brian Kotek, Mark Kruger, Mark Mandel, John Mason, Nathan Mische,
Adrian J. Moreno, Jake Munson, Ben Nadel, Jim Pickering, Jim Priest, Joe Rinehart,
Jared Rypka-Hauer, Terry Ryan, Chris Scott, and Matt Woodward
Lead Editor: Matthew Moodie
Technical Reviewers: Mark Drew, Brian Kotek, Mark Mandel, and Sean Corfield
Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell,
Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes,
Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft,

Matt Wade, Tom Welsh
Coordinating Editor: Debra Kelly
Copy Editor: Marilyn Smith
Production Support: Patrick Cunningham
Indexer: Brenda Miller
Artist: April Milne
Cover Designer: Anna Ishchenko
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or
visit www.springeronline.com.
For information on translations, please e-mail rights@apress.com, or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our
Special Bulk Sales–eBook Licensing web page at www.apress.com/info/bulksales.
The information in this book is distributed on an “as is” basis, without warranty. Although every
precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have
any liability to any person or entity with respect to any loss or damage caused or alleged to be caused
directly or indirectly by the information contained in this work.
The source code for this book is available to readers at www.apress.com.


www.it-ebooks.info

Contents at a Glance
Foreword ................................................................................................................ xxv
About the Authors . ................................................................................................xxvi
About the Technical Reviewers . ........................................................................ xxxvii
Acknowledgments . ........................................................................................... xxxviii
Introduction ......................................................................................................... xxxix
PART 1: COLDFUSION FUNDAMENTALS. ...................................................................... 1
■Chapter 1: Working with Application.cfc ................................................................ 3
■Chapter 2: Application.cfc Reference . .................................................................. 15
■Chapter 3: From User-Defined Functions to ColdFusion Components . ................. 17
■Chapter 4: onMissingTemplate()— Error Handler and So Much More . ............... 47
■Chapter 5: “Say What?” Handling Unknown Messages
■with onMissingMethod() ....................................................................................... 61
PART 2: DOCUMENT CREATION IN COLDFUSION. ....................................................... 73
■Chapter 6: PDF Support in ColdFusion .................................................................. 75
■Chapter 7: Image Processing in ColdFusion . ........................................................ 89

iii


www.it-ebooks.info
■ CONTENTS AT A GLANCE

PART 3: ESSENTIALS TO SERVER PRODUCTIVITY. ................................................... 101
■Chapter 8: Tuning Your Java Virtual Machine:
■Finding Your Ideal JVM Settings Through Metrics Log Analysis ........................ 103
■Chapter 9: The Shoemaker and the Asynchronous Process Elves. ..................... 111
■Chapter 10: Asynchronous Gateways Step-by-Step .......................................... 117
■Chapter 11: You Might Have a Performance Bottleneck If…. ............................. 121
PART 4: COMMUNICATION AND INTEGRATING WITH OTHER TECHNOLOGIES ........... 143
■Chapter 12: An Introduction to Consuming
■and Deploying Web Services in ColdFusion ....................................................... 145
■Chapter 13: Web Services and Complex Types .................................................. 157
■Chapter 14: Type Validation When Returning an Array of Components . ............ 179
■Chapter 15: Sending E-mail the Right Way ......................................................... 181
■Chapter 16: ColdFusion and Microsoft Exchange . ............................................. 189
■Chapter 17: BlazeDS . .......................................................................................... 199
PART 5: OBJECT-ORIENTED PROGRAMMING (OOP) . ............................................... 211
■Chapter 18: Object-Oriented Programming: Why Bother? .................................. 213

■Chapter 19: The Object-Oriented Lexicon . .......................................................... 217
■Chapter 20: Design Patterns: Exposing the Service Layer. ................................. 225
■Chapter 21: Beans and DAOs and Gateways, Oh My! . ....................................... 231
■Chapter 22: SOA for the Rest of Us ..................................................................... 239
■Chapter 23: How Base Classes Can Help You Generate Your Applications ......... 249
PART 6: COLDFUSION FRAMEWORKS . .................................................................... 257
■Chapter 24: An Introduction to Frameworks . ..................................................... 259
iv

www.it-ebooks.info
■ CONTENTS AT A GLANCE

■Chapter 25: Fusebox 5 Fundamentals . ............................................................... 265
■Chapter 26: Mach-II Fundamentals . ................................................................... 281
■Chapter 27: Model-Glue Fundamentals . ............................................................. 299
■Chapter 28: ColdSpring Fundamentals . .............................................................. 315
■Chapter 29: Reactor Fundamentals . ................................................................... 321
■Chapter 30: Developing Applications with Transfer . ......................................... 331
■Chapter 31: FW/1: The Invisible Framework . ..................................................... 347
PART 7: DESIGNING THE USER INTERFACE . ............................................................ 359

■Chapter 32: Separating Layout from Logic ......................................................... 361
■Chapter 33: Creating Dynamic Presentations in ColdFusion . ............................. 369
■Chapter 34: Working with JSON and cfajaxproxy .............................................. 375
■Chapter 35: Prototyping for Interface Driven Architecture:
■Easing the Transition from Prototype to Application . ........................................ 385
PART 8: DEVELOPMENT TOOLS ............................................................................... 389
■Chapter 36: Turbo Charging Eclipse . .................................................................. 391
■Chapter 37: An Introduction to ColdFusion Builder . .......................................... 407
■Chapter 38: The ColdFusion Debugger Explained:
■Interactive Step Debugging for ColdFusion 8 and 9 . .......................................... 421
■Chapter 39: Getting Started with Subversion . .................................................... 433
■Chapter 40: Subversion in the Workflow ............................................................ 445
■Chapter 41: Advanced Subversion ...................................................................... 451
■Chapter 42: Automating Your Development with Ant ........................................ 461
Index ....................................................................................................................... 477
v

www.it-ebooks.info

Contents

Foreword ................................................................................................................ xxv
About the Authors . ................................................................................................xxvi
About the Technical Reviewers . ........................................................................ xxxvii
Acknowledgments . ........................................................................................... xxxviii
Introduction ......................................................................................................... xxxix
PART 1: COLDFUSION FUNDAMENTALS. ..................................................................... 1
■Chapter 1: Working with Application.cfc ................................................................ 3
What Is an Application? ..................................................................................................... 3
Adding Application Variables . ........................................................................................... 5
The onApplicationStart Method ............................................................................................................... 5
The onSessionStart Method..................................................................................................................... 6
The onRequestStart Method .................................................................................................................... 7
The onError Method . ............................................................................................................................... 8
The onApplicationEnd Method ............................................................................................................... 10
The onSessionEnd Method .................................................................................................................... 10
The onRequestEnd Method .................................................................................................................... 11
The onRequest Method .......................................................................................................................... 11

A New Application Structure ........................................................................................... 13
■Chapter 2: Application.cfc Reference . .................................................................. 15


vi

www.it-ebooks.info
■ CONTENTS

■Chapter 3: From User-Defined Functions to ColdFusion Components . ................. 17
User-Defined Functions . ................................................................................................. 17
Creating UDFs . ...................................................................................................................................... 18
Executing UDFs and Passing Parameters .............................................................................................. 27
Error Handling. ...................................................................................................................................... 30
A Full UDF Example . ............................................................................................................................. 31

ColdFusion Components . ................................................................................................ 32
Creating CFCs . ...................................................................................................................................... 33
The CFC Container: The cfcomponent Tag ............................................................................................ 39
Implementing Security .......................................................................................................................... 39
Defining Properties: Variables and This ................................................................................................. 40
Understanding Encapsulation ................................................................................................................ 41
Caching Components. ........................................................................................................................... 41

Using Inheritance. ................................................................................................................................. 43

Parting Words .................................................................................................................. 45
■Chapter 4: onMissingTemplate()— Error Handler and So Much More . ............... 47
404 Missing Template Handling: Step-by-Step Basics ................................................... 47
Setting Global Handlers . ................................................................................................. 48
What Is the onMissingTemplate() Method, and When Is It Called? ................................ 49
Method Invocation within onMissingTemplate() . ............................................................ 51
When Errors Occur .......................................................................................................... 52
Reasons for Calling onMissingTemplate() ....................................................................... 53
Request Errors and Corrected Requests................................................................................................ 53
Content Redirects . ................................................................................................................................ 54
Dynamic Page Generation ..................................................................................................................... 55
Fusebox URL . ........................................................................................................................................ 58
Model-Glue URL . ................................................................................................................................... 59
vii

www.it-ebooks.info
■ CONTENTS


Mach-II URL . ......................................................................................................................................... 59

We’re Not Done Yet, but .................................................................................................. 59
■Chapter 5: “Say What?” Handling Unknown Messages
■with onMissingMethod() ....................................................................................... 61
Get the Message? . .......................................................................................................... 61
Message Received ........................................................................................................... 63
Defining onMissingMethod() . .......................................................................................... 64
Using onMissingMethod() . .............................................................................................. 65
Automatic get/set Methods ................................................................................................................... 66
Method Injection . .................................................................................................................................. 68
Aspect-Oriented Programming .............................................................................................................. 70

Summary . ....................................................................................................................... 72
Further Reading . ............................................................................................................. 72
PART 2: DOCUMENT CREATION IN COLDFUSION. ....................................................... 73
■Chapter 6: PDF Support in ColdFusion .................................................................. 75
PDF Support in ColdFusion MX 7 (and Earlier) ................................................................ 75
PDF Support in ColdFusion 8.0.1 and beyond ................................................................. 76
The isPDFFile and isPDFObject Functions . ..................................................................... 77
What Exactly Can We Do with the cfpdf Tag? ................................................................. 79
Getting and Setting Information............................................................................................................. 80
Adding a Watermark . ............................................................................................................................ 84
Using DDX . ............................................................................................................................................ 86

Where to Go Next ............................................................................................................ 88

viii

www.it-ebooks.info
■ CONTENTS

■Chapter 7: Image Processing in ColdFusion . ........................................................ 89
The cfimage Tag . ............................................................................................................ 89
Getting Image Dimensions with cfimage ............................................................................................... 89
Resizing an Image with cfimage ........................................................................................................... 90
Multiple Operations with cfimage.......................................................................................................... 91
Creating a CAPTCHA Image with cfimage.............................................................................................. 91

The New Image Processing Functions ............................................................................ 92
Image Drawing Functions ...................................................................................................................... 92
Image Manipulation Functions .............................................................................................................. 96
Image Information Functions ................................................................................................................. 97
Image I/O Functions............................................................................................................................. 100

Summary . ..................................................................................................................... 100
PART 3: ESSENTIALS TO SERVER PRODUCTIVITY. ................................................... 101
■Chapter 8: Tuning Your Java Virtual Machine:
■Finding Your Ideal JVM Settings Through Metrics Log Analysis ........................ 103
How the JVM Fits into ColdFusion . ............................................................................... 103
Enabling Metrics Logging . ............................................................................................ 104
Editing the jrun.xml File ....................................................................................................................... 105
Splitting Up the JRun Logs .................................................................................................................. 106
Examining the Metrics Logging Output ............................................................................................... 107
Finding the Proper Start and Maximum Heap Memory Size . ..............................................................108
The New Metrics. ................................................................................................................................ 109

Summary . ..................................................................................................................... 110

ix

www.it-ebooks.info
■ CONTENTS

■Chapter 9: The Shoemaker and the Asynchronous Process Elves. ..................... 111
by Doug Boude............................................................................................................... 111
The Experiment ............................................................................................................. 112
Before Employing Those Elves ...................................................................................... 115
The Moral of the Story . ................................................................................................. 115
Further Reading on Asynchronous Gateways . .............................................................. 115
■Chapter 10: Asynchronous Gateways Step-by-Step .......................................... 117
■Chapter 11: You Might Have a Performance Bottleneck If…. ............................. 121
If You Can't Tell a Manager from an Employee,
You Might Have a Performance Bottleneck . ................................................................. 121
If Your Foreign Key Values Are Not Defined in the ........................................................ 123
Database . . . . ................................................................................................................ 123
If You Relate Data Between Tables, but Neglect to Inform the Database . . . .............. 125
If You Store a Comma-Delimited List of Foreign Keys in a Single Column . . . . ............ 126
If You Use SELECT MAX( ID ) to Get the Primary Key of
a Newly Inserted Record . . . ......................................................................................... 129
If Your Only Transactions Are Between You and a Cashier . . ....................................... 130
If You Think the Difference Between Char and Varchar
Is Typing Three More Letters . . . . ................................................................................. 132
If You Think UTF-8 Is One of Those TV Channels
You Used to Get with Rabbit Ears . . . . .......................................................................... 134
If You Use More Than One Query to Read Data from Multiple Tables . . . . ................... 135
If the Only Index Your Database Knows Is Next to Your Middle Finger . . . .................. 137
If You Run Calculations on Data Using Your Application Code . . . ............................... 139
If the Contents of a Table Depend on the Phase of the Moon . . . ................................ 142
Build It Correctly from the Beginning............................................................................. 142
x

www.it-ebooks.info
■ CONTENTS

PART 4: COMMUNICATION AND INTEGRATION WITH OTHER TECHNOLOGIES ........... 143
■Chapter 12: An Introduction to Consuming
■and Deploying Web Services in ColdFusion ....................................................... 145
Deploying a Web Service from a CFC . .......................................................................... 146
Using a Remote Proxy Object......................................................................................... 147
Deploying a Web Service from a Standard ColdFusion Page ........................................ 148
Invoking Web Services in ColdFusion . .......................................................................... 151
Using the cfinvoke Tag ........................................................................................................................ 151
Using the CreateObject() Function ....................................................................................................... 152
Using the cfhttp Tag . .......................................................................................................................... 153
Invoking a CFM-Based Web Service .................................................................................................... 154

Error Handling . .............................................................................................................. 155
And Finally... . ................................................................................................................ 156
■Chapter 13: Web Services and Complex Types .................................................. 157
Consuming Web Services . ............................................................................................ 157
Passing Complex Types as Input Parameters ................................................................ 157
Nested Complex Types ........................................................................................................................ 159
Arrays . ................................................................................................................................................ 160
Attributes . ........................................................................................................................................... 162

Going to the Source . ..................................................................................................... 164
When Structures Are Not Enough ........................................................................................................ 169
WSDL2Java. ........................................................................................................................................ 171

Working with Complex Return Values............................................................................ 172
Publishing Web Services . ............................................................................................. 173
Other Resources . .......................................................................................................... 177

xi

www.it-ebooks.info
■ CONTENTS

■Chapter 14: Type Validation When Returning an Array of Components . ............ 179
Validating a Component ................................................................................................. 179
Validating an Array of Components . ............................................................................. 180
■Chapter 15: Sending E-mail the Right Way ......................................................... 181
The From Conundrum . .................................................................................................. 182
Checking E-mail Origins . .............................................................................................. 184
Sender Policy Framework (SPF) .......................................................................................................... 184
DomainKeys Identified Mail (DKIM) ..................................................................................................... 185
Real-Time Blacklists (RBLs)................................................................................................................. 185

Checking Sender Behavior............................................................................................. 185
Checking the Content . ........................................................................................................................ 186

Miscellaneous Commandments..................................................................................... 187
■Chapter 16: ColdFusion and Microsoft Exchange . ............................................. 189
ColdFusion and Exchange Integration Requirements . .................................................. 189
ColdFusion Exchange Tags . .......................................................................................... 190
Using cfexchangeconnection............................................................................................................... 190
Using cfexchangecalendar, cfexchangecontact, and cfexchangetask ................................................191
Using cfexchangemail ......................................................................................................................... 194
Using cfexchangefilter ......................................................................................................................... 195

ColdFusion and Exchange Interaction Best Practices ................................................... 196
Connections . ....................................................................................................................................... 196
Service Accounts . ............................................................................................................................... 197
SSL . .................................................................................................................................................... 197

Conclusion . ................................................................................................................... 197

xii

www.it-ebooks.info
■ CONTENTS

■Chapter 17: BlazeDS . .......................................................................................... 199
Messaging Patterns . ..................................................................................................... 199
BlazeDS vs. LCDS ................................................................................................................................ 200
What’s in a Name? . ............................................................................................................................ 200
Installing BlazeDS with ColdFusion ..................................................................................................... 202

Messaging Framework . ................................................................................................ 202
Running BlazeDS with a ColdFusion Event Gateway ...........................................................................204

Concluding Thoughts ..................................................................................................... 209
PART 5: OBJECT-ORIENTED PROGRAMMING (OOP) . ............................................... 211
■Chapter 18: Object-Oriented Programming: Why Bother? .................................. 213
OOP Fundamentals . ...................................................................................................... 213
Inheritance. ......................................................................................................................................... 214
Polymorphism . .................................................................................................................................... 214
Encapsulation . .................................................................................................................................... 214

So What?........................................................................................................................ 215
Where Do I Start? .......................................................................................................... 215
■Chapter 19: The Object-Oriented Lexicon . .......................................................... 217
■Chapter 20: Design Patterns: Exposing the Service Layer. ................................. 225
Model-View-Controller (MVC) . ...................................................................................... 225
Handling Sessions . ............................................................................................................................. 226
Returning Data. ................................................................................................................................... 228
Accessing the Application ................................................................................................................... 229

Conclusion . ................................................................................................................... 229

xiii

www.it-ebooks.info
■ CONTENTS

■Chapter 21: Beans and DAOs and Gateways, Oh My! . ....................................... 231
A Four-Layer Cake . ....................................................................................................... 231
A Review of Recipes . .................................................................................................... 233
What Are Those Ingredients? ........................................................................................ 236
Eating Well or Poor Diet? . ............................................................................................. 237
Real-World Web Applications . ...................................................................................... 238
■Chapter 22: SOA for the Rest of Us ..................................................................... 239
SOA Components . ......................................................................................................... 239
SOA vs. OOP ................................................................................................................... 239
SOA Code Organization ................................................................................................. 241
Web Services . ............................................................................................................... 241
Data Formats . ..................................................................................................................................... 242
Security . ............................................................................................................................................. 243
Error Handling. .................................................................................................................................... 245
Discoverability . ................................................................................................................................... 246
Service Interfaces. .............................................................................................................................. 247

■Chapter 23: How Base Classes Can Help You Generate Your Applications . ....... 249
Base Class Basics ......................................................................................................... 249
It’s All About the API . .................................................................................................... 251
A Simple Example . .............................................................................................................................. 252
The Variables Define the API ............................................................................................................... 252

Types of Methods .......................................................................................................... 254
Metaprogramming . ....................................................................................................... 254
Summary . ..................................................................................................................... 255
Resources . .................................................................................................................... 255

xiv

www.it-ebooks.info
■ CONTENTS

PART 6: COLDFUSION FRAMEWORKS ...................................................................... 257
■Chapter 24: An Introduction to Frameworks . ..................................................... 259
Can Someone Just Tell Me What They ARE Already? . .................................................. 259
Frameworks that Focus on HTML and the User Interface.............................................. 260
Fusebox . ............................................................................................................................................. 260
Model-Glue . ........................................................................................................................................ 261
Mach-II . .............................................................................................................................................. 262
ColdBox. .............................................................................................................................................. 262

Back-End and Service Frameworks .............................................................................. 263
ColdSpring . ......................................................................................................................................... 263
Reactor . .............................................................................................................................................. 263
Transfer . ............................................................................................................................................. 264

Summary . ..................................................................................................................... 264
■Chapter 25: Fusebox 5 Fundamentals . ............................................................... 265
Fusebox—What and Why . ............................................................................................ 265
Fusebox Concepts . ............................................................................................................................. 266
Fusebox Benefits . ............................................................................................................................... 268

What’s New in Fusebox 5 and 5.5 . ............................................................................... 270
Compatibility. ...................................................................................................................................... 270
Coding Styles . ..................................................................................................................................... 270
Multiple Applications ........................................................................................................................... 272
Application Initialization ...................................................................................................................... 273
Custom Lexicons . ............................................................................................................................... 273
XML Grammar. .................................................................................................................................... 276
Dynamic Do . ....................................................................................................................................... 278
Application.cfc Support ....................................................................................................................... 278
The event Object . ................................................................................................................................ 278
The myFusebox Object ........................................................................................................................ 279
xv

www.it-ebooks.info
■ CONTENTS

Search-Engine-Safe URLs ................................................................................................................... 279
Runtime Control . ................................................................................................................................. 279

Why Upgrade? . ............................................................................................................. 280
■Chapter 26: Mach-II Fundamentals . ................................................................... 281
Introducing the Mach-II Framework . ............................................................................ 281
Installing Mach-II ........................................................................................................... 283
The Mach-II Application Skeleton . ................................................................................ 286
Mach-II’s XML Configuration File .................................................................................. 286
Properties . .......................................................................................................................................... 290
Listeners . ............................................................................................................................................ 291
Event Filters . ....................................................................................................................................... 291
Plugins . ............................................................................................................................................... 292
Event Handlers . .................................................................................................................................. 292
Page Views . ........................................................................................................................................ 292

Hello Mach-II. ................................................................................................................ 292
Let’s Get Personal ......................................................................................................... 294
Conclusion . ................................................................................................................... 297
■Chapter 27: Model-Glue Fundamentals . ............................................................. 299
A Recipe for Spaghetti . ................................................................................................. 300
Fun with Front Controller . ............................................................................................. 301
Installing Model-Glue ..................................................................................................... 301
Starting a New Model-Glue Application ......................................................................... 302
Creating the Application Manually ....................................................................................................... 302
Automating Application Creation ......................................................................................................... 303

Model-Glue XML Files in a Nutshell .............................................................................. 304
ColdSpring XML Configuration File ...................................................................................................... 304
The Model-Glue XML Configuration File .............................................................................................. 305

xvi

www.it-ebooks.info
■ CONTENTS

Your First Model-Glue Application . ............................................................................... 309
Setting Up the Form............................................................................................................................. 309
Adding Functionality . .......................................................................................................................... 310
Finishing Up . ....................................................................................................................................... 312

Conclusion . ................................................................................................................... 313
■Chapter 28: ColdSpring Fundamentals . .............................................................. 315
The Problem of Dependency in System Design . ........................................................... 315
ColdSpring and Component Management . ................................................................... 316
Some Development Concepts ....................................................................................... 318
Unit Testing. ........................................................................................................................................ 318
Test-Driven Development .................................................................................................................... 318
Too Many Dependencies Can Spoil the Model..................................................................................... 318
Back to ColdSpring . ............................................................................................................................ 319

Using ColdSpring to Architect Your Application in Logical Tiers .................................. 319
■Chapter 29: Reactor Fundamentals . ................................................................... 321
The Origin of Reactor . ................................................................................................... 321
A Look at Reactor .......................................................................................................... 322
Installing Reactor ........................................................................................................... 323
Some Simple Reactor Examples ................................................................................... 324
How Does Reactor Work? . ............................................................................................ 325
Slightly More Interesting Reactor Examples ................................................................. 326
Using Iterators ............................................................................................................... 328
Learning More About Reactor . ...................................................................................... 329

xvii

www.it-ebooks.info
■ CONTENTS

■Chapter 30: Developing Applications with Transfer . ......................................... 331
Transfer—An ORM for ColdFusion . .............................................................................. 332
Installing and Configuring Transfer . ............................................................................. 332
The Transfer Data Source Configuration File ....................................................................................... 332
The Transfer Object Configuration File ................................................................................................ 333
Mapping Objects to Tables .................................................................................................................. 335

Using Transfer . ............................................................................................................. 338
Creating the TransferFactory ............................................................................................................... 338
Creating a New Object ......................................................................................................................... 339
Saving an Object . ................................................................................................................................ 339
Retrieving an Object ............................................................................................................................ 341
Deleting an Object . ............................................................................................................................. 342
Using List Queries. .............................................................................................................................. 343

Other Transfer Functionality . ........................................................................................ 344
Conclusion . ................................................................................................................... 345
■Chapter 31: FW/1: The Invisible Framework . ..................................................... 347
What Happened to ColdFusion’s Simplicity? . ..............