Introduction to ColdFusion

Download Report

Transcript Introduction to ColdFusion

Introduction to ColdFusion
Penn State Web 2001 Conference
Brian Panulla
Elmwood Media Group, LLC
What is ColdFusion?
 Formerly
produced by Allaire
Corporation (now Macromedia), the
ColdFusion Web Application Server is a
multi-platform Internet programming
engine.
 So
what does this mean?
Content © 2001 Brian Panulla
CF as a Programming Platform


Program code, written
in CFML (the
ColdFusion Markup
Language) is
interpreted and
executed on the Web
server by the CF
Server.
The result of CF code is
generally a DHTML
document.
CF Server
Internet User
Content © 2001 Brian Panulla
Coding in CFML
 CFML code
is organized into templates.
A single template is generally analagous
to a single static Web page.
 When a CFML template is requested by
a client through the Web server, the
template is first processed by the
ColdFusion Application Server
Content © 2001 Brian Panulla
Coding in CFML

Generally, the end result of a processed
CFML template is a normal DHTML
document. This document may contain:






HTML
JavaScript
VBScript
CSS
Embedded Java Applets
Or any other client-side technologies
Content © 2001 Brian Panulla
Coding in CFML
 During
the execution phase, the
ColdFusion server replaces any CFMLspecific code with the output of that
code.
 This allows you to completely generate
a dynamic HTML document with CFML
instructions.
Content © 2001 Brian Panulla
Tying In To Other Resources

In addition to being a full-featured
programming language, the real power of
CFML lies in the ability to access other
network resources, including:





Databases!
Directory Servers (LDAP)
Mail Servers (using SMTP and POP)
Other Web or FTP servers
COM Objects
Content © 2001 Brian Panulla
Reading Data From A Database

Databases may be accessed through ODBC,
OLE-DB, and native database connections.
Some common database plaforms are:






MS Access
SQL Server
Oracle
DB2
MySQL
Interaction is generally accomplished with
queries written in SQL, the standard relational
database query language.
Content © 2001 Brian Panulla
Sample CFML Code
<cfquery name=“myQuery” datasource=“myDB”>
SELECT * FROM Events
</cfquery>
<table border=“1”>
<cfoutput query=“MyQuery”>
<tr>
<td>#MyQuery.Event#</td>
<td>#MyQuery.Date#</td>
</tr>
</cfoutput>
</table>
Content © 2001 Brian Panulla
Why use ColdFusion?
 Upsides:
 Excellent
development tools
 Runs on Windows (98/NT/2000), Solaris,
Linux, HP/UX
 Easy learning curve for non-programmers
 Higher productivity for skilled developers
 A terriffic local User Group!*
*See www.cfug-sc.org
Content © 2001 Brian Panulla
Why not to use ColdFusion
 Downsides:
 Somewhat
expensive (though less so for
educational institutions) for Professional
and especially Enterprise editions
 Language and software are proprietary
 Building extremely scalable sites is difficult
(though certainly possible! See
AutoByTel.com and FAOSchwatz.com)
Content © 2001 Brian Panulla
For small departments or
organizations, CF is a winner!

With a lower cost of maintenance and easier
learning curve than other languages, CFML
can help with rampant IT turnover and
retraining costs.
 A skilled developer in another language (ASP,
PHP) can apply most of their skills to
developing with CFML (DHTML, SQL).
Content © 2001 Brian Panulla
For Further Reading…
 “Yes,
YES, it can scale” by Ben Forta,
ColdFusion Developers Journal, Vol 1
Issue 4
 “When NOT to Use ColdFusion” by Ben
Forta, ColdFusion Developers Journal,
Vol 2 Issue 3
Content © 2001 Brian Panulla