Introduction to ColdFusion - PowerPoint PPT Presentation

About This Presentation
Title:

Introduction to ColdFusion

Description:

It will however, let you write powerful web applications ... Greate for narrowing results or re-ordering. Although it supports it, not a good idea to join. ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 19
Provided by: stude6
Learn more at: http://www.cs.rpi.edu
Category:

less

Transcript and Presenter's Notes

Title: Introduction to ColdFusion


1
Introduction to ColdFusion
  • By Tom Dubeck

2
Overview
  • What is ColdFusion?
  • How does it compare to other scripts?
  • Some example code.
  • Why you might want to use it.
  • Installing ColdFusion.
  • Controlling ColdFusion.

3
What is ColdFusion?
  • ColdFusion ! Cold Fusion, it will not power your
    computer or win you a Nobel Prize in Physics
  • It will however, let you write powerful web
    applications relatively quick and straightforward
    as compared to some other web scripts.

4
Other language Comparisons Perl
  • Interpreted on a character basis
  • Any shared data must go through hidden HTML field
    or manually created cookies.
  • Both HTML and Headers must be spelt out using
    Print commands
  • Syntax similar to C but with a lot more
    punctuation characters in weird places.
  • Object Oriented?

5
Other Language ComparisonASP/VBscipt
  • Interpreted on a Character basis
  • Pages are loaded individually, but can be easily
    connected through Session and Application
    variables.
  • ASP code is inserted in between normal HTML with
    special lt gt tags (much like JSP).
  • Very different Syntax than C/Perl/etc, but very
    human readable.
  • Barely Object Oriented

6
Other Language ComparisonColdFusion
  • Interpreted on a Tag basis. Also administered by
    local Admin page.
  • Like ASP, has Session, Application, and other
    scopes that can share information from page to
    page.
  • Each Logic control or Data structure is
    represented by its own HTML/XML-ish tag, highly
    intermingled.
  • Structures and Custom tags, not quite objects

7
Source Comparison
8
Tag based Code
  • ltcfsetgt to declare/set variables
  • ltcfloopgt for any kind of loop, index/while/contain
    er
  • ltcfoutputgt for both plain printing and
    containers/lists
  • ltcfquerygt for database access
  • ltcfparamgt for easy form field or argument
    validation and access

9
Operators
  • In CFML, ltgt already used in tags.
  • - is, equal, or eq
  • ! - is not, not equal ne
  • gtltgt- gt, lt, greater than or equal, gte
  • XOR, EQV, IMP, and MOD supported as well.

10
Make your own tags, kind of like OOP
  • Define a template MyClass.cfm
  • Use ltcfparamgt to take in attributes
  • Use thistag.executionmode to set behaviors for
    endtags
  • Tag is calledltcf_MyClassgt.

11
Why ColdFusion?
  • Very high interactivity and support with
    Macromedia products include Flash and
    Dreamweaver.
  • Verity Search Engine takes all the work out of
    full text searches.
  • Admin page keeps important system settings
    (Databases, error handling) standardized between
    pages and hidden from those that dont need to
    know.
  • Very powerful query control
  • Easy to use variable validation.

12
ColdFusion in ActionVerity Search through
Database
  • ltcfquery name"descriptions" dataSourceStore"gt
  • Select ItemNumber, Description
  • From MainInventory
  • lt/cfquerygt
  • ltcfparam nametxt" defaultnothing"gt
  • ltcfindex collection"ProductSearch"
    body"Description" key"ItemNumber"
    query"descriptions"gt
  • ltcfsearch name"Products" collection"ProductSearc
    h" criteria"txt"gt
  • ltcfquery nameresults" datasourceStore"
    dbtype"ODBC"gt
  • Select From Products
  • Where key in (ValueList(Products.Key))
  • lt/cfquerygt

13
ColdFusion in ActionQuery of Queries
  • ltcfquery namealldata" dataSourceStore"gt
  • Select
  • From MainInventory
  • lt/cfquerygt
  • ltcfquery nameGetByType" dbtypequery"gt
  • Select ItemNumber, Description
  • From alldata
  • Where typeElectronics
  • lt/cfquerygt

14
Query of Queries
  • Uses the Query object instead of the database.
  • Greate for narrowing results or re-ordering.
  • Although it supports it, not a good idea to join.

15
In case you dont like CFML
  • ltcfscriptgt tag- works like ltscriptgt tag for
    JavaScript or ltgt for SP.
  • Supports for, while, do while loops identical to
    JavaScript.
  • Function to declare functions, var to declare
    varibles, return anything you want. In other
    words, just like JavaScript.
  • No print command, have to return a string and
    ltcfoutputgt

16
Installing ColdFusion
  • Can be done with or without a previous Web
    server.
  • Can get a free developers version to tinker with
    on your machine from www.macromedia.com.
  • Default settings generally work.

17
ColdFusion Admin
  • Conveniant place to control your Data Sources,
    Verity Collections, System settings, and
    Debug/Error handling.

18
ColdFusion Resources
  • Macromedias Developers Forum
  • Various online tutorials
  • Various books
Write a Comment
User Comments (0)
About PowerShow.com