The book will not teach ColdFusion, it will be a review guide and will provide helpful pointers for examinees. The book will look non-intimidating yet thorough, and will be highly readable in small bite-sized chunks.
Each subject will be presented in clear and direct language, with useful and well explained code examples. Sample questions will accompany each subject, as will references to recommended reading (Allaire documentation, Allaire course work, and existing MCP ColdFusion books).
|Product dimensions:||6.02(w) x 8.98(h) x 0.88(d)|
About the Author
Read an Excerpt
Chapter 1: Web Technology and Terminology
Effective ColdFusion development requires a solid understanding of Internet and Web concepts, terms, and technologies. So, in this first chapter, we'll start with a brief review of these.
The Internet is simply the world's biggest computer network. It connects millions of hosts (computers, servers, devices, and so on) to each other so that they can communicate and interact.
The Internet is not a physical entity, nor is it any particular host or set of hosts. You could never point to a machine and identify it as the Internet, nor could you ever turn the Internet on or off. The Internet is a living entity. and one that is evolving and changing all the time.
The Internet is held together by 1P, the Internet Protocol, and every host connected to the Internet must be running a copy of IP.
IP requires that every host have a unique address by which to identify it. The unique identifiers are IP addresses that (in the current version of IP) are made up of four sets of numbers separated by periods-for example, 208. 193.16.250. Some hosts have fixed (or static) 1P addresses; others have dynamically assigned addresses. Regardless of how an IP address is obtained, no two hosts connected to the Internet may use the same IP address at any given time. (The exception to this rule is addressing used on private networks, which need just be unique within that network.)
IP addresses are the only way to uniquely specify a host. When you want to communicate with a host-for example, a Web server-you must specify the IP address of the Web server you're trying to contact. Similarly, when you connect to an FTP server, or specify the SMTP and POP servers in your mail client, you must specify the name of the host to which you want to connect. As you know from browsing the Web, you rarely specify IP addresses directly. You do, however, specify a host name, such as www.forta.com. If hosts are identified by IP address, how does your browser know which Web server to contact if you specify a host name`?
The answer is the Domain Name Service (DNS), a mechanism that maps host names to IP addresses. When you specify the destination address of www.forta.com, your browser sends an address resolution request to a DNS server asking for the IP address of that host. The DNS server returns an actual IP address--in this case, 208. 193.16. 250. Your browser can then use this address to communicate with the host directly.
DNS is never required. Users can always specify the name of a destination host by its IP address to connect to the host. There are, however, some very good reasons not to use the IT address:
- IP addresses are hard to remember and easy to mistype. Users are more likely to find www.forta.com than they are 188.8.131.52.
- IP addresses are subject to change. For example, if you switch service providers, you might be forced to use a new set of IT addresses for your hosts. If users identified your site only by its IP address, they never could reach your host if the IP address changed. Your DNS name stays the same, even if your IP address switches. You need to change only the mapping so that the host name maps to the new correct IP address.
- Multiple hosts, each with unique IP addresses, can all have the same DNS name. This allows load balancing between servers, as well as the establishment of redundant servers.
- A single host, with a single IP address, can have multiple DNS names. This enables you to create aliases if needed. For example, ftp. forta. com and www. forta. com might point to the same IP address, and thus the same server.
The World Wide Web
The Web is what put the Internet on the map, and made it a household word. Many people mistakenly think the Internet is the Web. The truth, however, is that the Web is merely an application that sits on top of the Internet. The Web is built on the Hypertext Transfer Protocol (HTTP). HTTP is designed to be a small, fast protocol that is well suited for distributed multimedia information systems and hypertext jumps between sites.
Information on the Web is stored in pages. A page can contain any of the following:
Each Web page is an actual file saved on a host. When a Web page is requested, the file containing the Web page is read and its contents are sent to the host that asked for it.
A Web site is simply a collection of Web pages along with any supporting files (such as GIF or JPG graphics). Creating a Web site thus involves creatin- one or more Web pages and linking them. The Web site is then saved on a Web server.
The Web consists of pages of information stored on hosts running Web-server software. The host is often referred to as the Web server which is technically inaccurate. The Web server is actually software and not the computer itself. Versions of Web server software can run on almost all computers, and although most Web server applications do have minimum hardware requirements, no special computer is needed to host a Web server.
Originally, Web development was all performed under different flavors of UNIX. Most Web servers still run on UNIX boxes, but this is changing. There are now Web-server versions for almost every major operating system. Web servers hosted on high-performance operating systems, such as Windows NT, are becoming more and more popular because UNIX is still more expensive to run than Windows NT and is also more difficult to use for the average user. Windows NT (and especially Windows 2000) has proven itself to be an efficient, reliable, and cost-effective platform for hosting Web servers. As a result, Windows NT's slice of the Web server operating system pie is growing dramatically. So, what exactly is a Web server? It's a program that serves up Web pages upon request. Web servers typically don't know or care what they're serving. When a user at a specific IP address requests a specific file (a Web page), the Web server tries to retrieve that file and send it back to the user. The requested file might he the HTML source code for a Web page. a GIF image, VRML, worlds...
Table of Contents(NOTE: Each Chapter ends with Summary and Sample Questions.)
I. THE BASICS.
The World Wide Web.
Web Servers. Web Browsers.
Application Servers. ColdFusion Fundamentals.
How ColdFusion Works.
2. Working with Variables and Expressions.
Reason One to Use Prefixes: Performance. Reason Two to Use Prefixes: Avoiding Ambiguity. A Reason Not to Use Prefixes: Flexibility.
Creating Local Variables. Using Local Variables. Variables and the Request Scope. Functions.
Nested Functions. Functions with Masks.
Constant String Manipulation. Regular Expression String Manipulation.
3. Conditional Processing.
Index. Conditional. Query. List. Collection.
5. Redirects and Reuse.
Using HTTP Headers. Reuse.
Reuse and Including Files. ColdFusion Mappings. Web ServerMappings. Variable Scoping and
Generating Non-HTML Content.
6. The Application Framework.
Application.cfm. OnRequestEnd.cfm. Multiple Application.cfm Files.
7. Using Databases.
Adding a Datasource.
Connecting to the Database. Simplified Database Connectivity. Displaying Data.
Grouping Data with
II. VARIABLES AND EXPRESSIONS.
Passing Multiple Variables at Once. Passing Complicated Strings.
What Is the Scope of a URL Variable? Using URL Variables.
9. FORM Variables.
10. APPLICATION and SERVER Variables.
11. Session State Management.
Making Cookies. Using Cookies. A Cookie's Scope.
Preparing to Use SESSION Variables. Using SESSION Variables. Creating SESSION Variables.
Preparing CLIENT Variable Storage. Creating CLIENT Variables. Using CLIENT Variables.
Which Variables Should I Use?
Using the NAME Attribute. Using the SCOPE Attribute. READONLY Locks.
Option 1 (No Checking Done by ColdFusion Server). Option 2 (Full Checking Done by ColdFusion Server). Option 3 (Automatic Read Locking).
Dealing with Deadlocks.
III. DATA TYPES.
Creating Lists. Accessing List Elements. Modifying Lists. Specifying Delimiters.
When to Use Lists (and When Not To). Sorting Lists. Looping Through Lists. Nested Lists. Special Lists.
When to Use Arrays. When Not to Use Arrays.
Creating Arrays. Populating Arrays. Converting Between Arrays and Lists. Printing Array Values. Empty Array Indexes. Arrays and Memory. Compressing Arrays.
Two-Dimensional Arrays. Three-Dimensional Arrays. Looping Over and Printing Multidimensional Arrays.
When to Use Structures. Creating Structures.
Types of Structures. Looping Over Structures. Internal Structures. Combining Complex Data.
Arrays of Structures. Structures of Arrays. Structures of Structures.
Structures as Pointers. Referring to Queries Using Structure and Array Syntax.
IV. ADVANCED COLDFUSION.
Variable Assignment. Conditional Processing.
IF Examples. SWITCH/CASE Examples.
FOR Loop. WHILE Loop. DO-WHILE Loop. FOR-IN Statement.
17. Dynamic Functions.
IIf(). DE(). Evaluate().
18. Stored Procedures.
Performance Monitoring. Stack Trace. Show Variables. Show Processing Time. Detail View. Show SQL and Datasource Name. Show Query Information. Display Template Path.
Manual Debugging. ColdFusion Studio Debugger. Log Files.
21. Error Handling.
V. EXTENDING COLDFUSION.
Simple Syntax (CF_).
Attributes. Caller Scope.
23. Advanced Custom Tags.
ThisTag.ExecutionMode. ThisTag.HasEndTag. ThisTag.GeneratedContent.
Child Tags. Custom Tag Functions.
24. COM, CORBA, CFX, and Java.
COM and DCOM. CORBA. Java Objects and EJB.
VI. SERVICES AND PROTOCOLS.
Creating and Indexing Collections. Maintaining Collections. Optimizing Collections.
Creating a Search Interface.
27. System Integration.
Working with Files. Uploading Files to the Server. Delivering Files from the Server. Working with Directories.
Registry Integration. Executing from the Command Line.
28. Scheduling and Event Execution.
Scheduling a Task. Publishing to Static Pages. Logging Scheduled Events.
Alternative Scheduling Options.
29. Email Integration.
Sending Simple Text Email. Sending HTML Email.
Sending File Attachments. Additional Mail Headers.
Retrieving POP Mail.
POP Dates. File Attachments. Deleting Mail.
Troubleshooting ColdFusion Mail.
31. Other Internet Protocols.
Creating HTTP Agents. Remote Data File Queries. Troubleshooting HTTP Agents. Page Scraping. Back-End Pages and Robots.
Specifying the Data to Retrieve. Specifying the Table. Filtering. Sorting.
The INSERT Statement. The UPDATE Statement. The DELETE Statement.
Basic Join Syntax. Inner Joins. Outer Joins. Self-Joins.
Handling NULL Values. Processing Distinct Values.
Grouping Results. Filtering Results.
35. Advanced Database Features.
Unique Constraints. Check Constraints.
Understanding Indexes. Stored Procedures. Triggers. Bind Parameters.
36. Improving Performance.
Variable-Based Query Caching. Query Result Caching.
Reducing Data Transfer Time.
VIII. TUNING AND OPTIMIZATION.
Different Variable Scopes and Performance. Don't Nest
Don't Do the Database's Job with ColdFusion. Enforcing Strict Attribute Validation. Using
Execution Time. Exploded Benchmarking. Using GetTickCount().
38. Server Performance Tuning.
Template Cache/P-Code Caching. Trusted Cache. Simultaneous Requests.
Monitoring Server Performance.
Performance Monitor. CFSTAT.