Advanced ColdFusion 8: Components, Error Handling and Complex Objects
Once you have mastered ColdFusion's basics, it is time to discover
its more advanced options. We will explore the many methods of reusing
code (including <cfinclude>, custom tags and stored procedures).
Using session variables and cookies, we will create a Password Protected
section of the site to increase security.
We will teach you how to predict and prevent errors so your users
will never see an ugly error page. Using Regular Expressions, we
will perform advanced Form Validation. Although ColdFusion does
allow for quick an easy development, it still is a robust, powerful
language. We will explore programming concepts including loops,
arrays, structures and two methods for writing User-Defined Functions
(UDFs).
Course Outline
Module 1: Manipulating Complex Data Objects (Lists, Arrays, Structures and Queries)
- Complex Data Objects
- Scalar Variables
- Lists
- Arrays
- Structures
- Exercise: Arrays and Lists
- Looping with <cfloop>
- Syntax of <cfloop>
- Weeding Out the FIELDNAMES Variable
- Using <cfloop> for automatic query output
- Display Web-safe Colors using CFLOOP
- Exercise: Display results with <cfloop>
- Queries of Queries
- Demo: Query of Query
- Exercise: Query of query to display “classic movies”
- <cfscript>
- Capabilities of <cfscript>
- Syntax Rules
- Reserved Words
- Looping with <cfscript>
- GetTickCount() - testing the speed of your code
- Exercise: Setting Variables with <cfscript>
- Custom Tags
- Demo: custom tags
- Where to store Custom Tags
- Demo: Custom Tag with Parameters
- CALLER and ATTRIBUTE scopes
- Using <cfmodule>
- Exercise: Using Custom Tags
- Building ColdFusion Components
- Benefits to using CFCs
- Creating Components
- Calling or Invoking Components
- Passing Arguments to Components
- The main CFML page
- Three Ways to Pass Arguments
- Where to save CFCs
- Self-documenting - View a Component directly in the browser
- Exercise: Creating ColdFusion Components with Arguments
- Object-Oriented CFCs
- Object-Oriented Principles
- Demo: CFC using Object-Oriented Model
- How does use of a CFC compare to other OO languages?
- Demo: CFC using Object-Oriented Model
- Inheritance
- Demo: Inherit from another CFC
- Access control
- Exposing CFCs as Web Services
- Exercise: Build OOP CFC with Parameters to Edit Courses
- Automatic Includes: Application.cfm and onRequestEnd.cfm
- New Application Framework: Application.cfc
- Exercise: Store DSN and Company Name as Application Variables
- Using Application Variables
- Exercise: Cycle through Featured Movies Using Application Variables
- Standard Error Handling
- Application.cfm
- Demo: the error page
- Demo: detailed error page
- Exercise: Replace the Default Error Page
- Structured Error Handling
- <cftry> and <cfcatch>
- Demo: Using <cftry>
- Transactions with <cftransaction> and <cftry>
- Classic <cftransaction> example
- Demo: Using <cftransaction> with <cftry>
- Exercise: Using <cftransaction> to Avoid Errors
- Stored Procedures
- Benefits of Stored Procedures
- Demo: Stored Procedure
- Demo: pass a parameter to a stored procedure
- Exercise: Pass Parameters to a Stored Procedure
- Showing portions of a Recordset
- Paging through records
- Exercise: Add “Next” and “Previous” links to the Actors list
- Using Regular Expressions
(Optional)
- Special Symbols for Matching Specific Characters
- Specify the number of occurrences
- Placement of the pattern
- POSIX Syntax
- Perl Syntax
- Demo: Testing Regular Expressions
- Exercise: Using Regular Expressions for Advanced Form Validation
Appendices
- Appendix A: Resources
- Appendix B: Set-up Notes
- Appendix C: Create a Dreamweaver “Site”
- Site Creation – Basic
- Site Files Panel
- “Create a Site” vs. “FTP or RDS Server Connection”
- Appendix D: Selecting Among ColdFusion Code Reuse Methods
See also
Adobe ColdFusion 8 Training Courses
|