Introduction to ColdFusion

horseheadssolidInternet and Web Development

Nov 10, 2013 (3 years and 7 months ago)

76 views

Introduction to ColdFusion

Yu Fu

2003 MEC Candidate

2

Agenda


What is ColdFusion


Core Components & Features


Some Statistics


Limitations


Latest Development


Conclusion


3

What Is ColdFusion


A commercial Web application development
environment


Created by Allaire Corp., owned by Macromedia Inc.
since 2001


Available on Windows, Unix and Linux


Three editions


Developer, Standard, Enterprise


Not cheap


$1000 plus for standard edition


$4000 plus for enterprise edition


4

Competitors


CGI


ASP


PHP


J2EE


.NET


5

Core Components


ColdFusion Application Server


ColdFusion Administrator


ColdFusion Studio


ColdFusion Markup Language (CFML)

6

ColdFusion Application Server


A middleware between Web server and
other servers like database, email,
LDAP, FTP, etc.


The engine/processor of CFML


Parse ColdFusion application pages,
which contain CFML and HTML tags and
saved with file extension .cfm, to
generate dynamic HTML documents


7

How It Works

(Source:

Macromedia® ColdFusion® MX Development

By Eric

Ladd )

8

Features


page cashing for short response time


Load balancing for scalable
performance and high throughput


Automatic failover for reliability and
availability


Full
-
text indexing and searching


Extensive support for third
-
party
servers

9

ColdFusion Administrator


It is a Web application written in CFML!


A administration tool to configure and
maintain ColdFusion Application Server


Set up database source (DSN)


Schedule ColdFusion application page
execution


Manage debug, session, security settings


Checking server logs

10

11

ColdFusion Studio


An IDE (Integrated Development
Environment) tool


Make ColdFusion application development
much easier for developers


The part I like best


Tons of CFML code examples


Detailed documentation on CFML, HTML, CSS, etc.


Global search and change

12

13

CFML: ColdFusion Markup Language


A server
-
side scripting language to create
ColdFusion application pages (.cfm)


It is a language created from XML


Tag based


All tags start with CF


Intuitive and easy to learn


if you know HTML


14

Some CFML tags

CFSET


Defines a variable.

CFOUTPUT


Displays a variable.

CFIF CFELSEIF CFELSE


Used to create IF
-
THEN
-
ELSE constructs.

CFLOOP


Repeats a set of instructions based on a set of
conditions.

CFMAIL


Assembles and posts an email message.

CFQUERY


Passes SQL to a database.

CFCOOKIE


Defines and sets cookie variables.

(Source: ColdFusion Documentation)

15

A Basic CFML Example

<HTML>

<HEAD>

<TITLE>Hi</TITLE>

</HEAD>

<BODY>

<STRONG>Message</STRONG>

<!
---

Set a variable
---
>

<CFSET Name=“Fu Yu">

<!
---

Display result
---
>

<CFOUTPUT>

Hello, #Name#!

</CFOUTPUT>

</BODY>

</HTML>


<HTML>

<HEAD>

<TITLE>Hi</TITLE>

</HEAD>

<BODY>

<STRONG>Message</STRONG>

Hello, Fu Yu!

</BODY>

</HTML>

Original CFML Script

Result HTML document

16

CFML Cont’


Extensive features to build powerful Web
applications


Email


FTP


HTTP


LDAP


Full
-
text indexing/searching


Encryption


etc.


17

An Email Example

<HTML>

<HEAD>

<TITLE>Sending a simple email</TITLE>

</HEAD>

<BODY>

<CFMAIL


FROM="Sender@Company.com"


TO="#URL.email#"


SUBJECT="Sample email"

>

This is a sample email to show basic email capability.

</CFMAIL>


<H1>Sample email</H1>


The email was sent.



</BODY>

</HTML>


(Source: ColdFusion Documentation)

18

CFML Cont’


Strongest point is database integration


The least code amongst peers


Dirty works are handled by ColdFusion
Application Server


19

A Database Query Example

<HTML>

<HEAD>

<TITLE>Employee List</TITLE>

</HEAD>

<BODY>

<H1>Employee List</H1>


<CFQUERY NAME="EmpList" DATASOURCE="CompanyInfo">


SELECT FirstName, LastName, Salary, Contract


FROM Employees

</CFQUERY>


<CFOUTPUT QUERY="EmpList">

#FirstName#, #LastName#, #Salary#, #Contract#<BR>

</CFOUTPUT>

</BODY>

</HTML>

(Source: ColdFusion Documentation)

20

CFML Cont’


Extensible through custom tags


Java


C++


Delphi


CFML


etc.


21

Some Statistics


More than 125,000 ColdFusion servers deployed


An estimated base of over 300,000 developers


Purchased by more than 10,000 organizations,
including 75 of the Fortune 100 companies


Used to develop more than 19.7 million ColdFusion
pages (Google)


Global network of more than 360 user groups



(Source: MacroMedia Inc.)

22

Limitations


It is not free


Business logic mixed with presentation
markup


So do CGI, PHP, ASP


Not a issue for small and medium sized Web
applications


hard to maintain and enhance when logic
becomes too complex


J2EE and .NET do a better job here


23

Latest Development


ColdFusion Application Server For J2EE


A Java application which can be deployed on J2EE
platform such as WebLogic, WebSpere, JRun, Sun
ONE, JBoss, etc


Compile ColdFusion application pages into Java
byte codes


Enhanced CFML to support JSP, Servlet and Web
Services


Latest version: MX 6.1


24

Conclusion


ColdFusion is a easy
-
to
-
use and
powerful platform to build small to
medium sized Web applications with
probably the shortest time to market


ColdFusion is still evolving, ColdFusion
+ J2EE maybe a good bet

25

References


ColdFusion Documentation inside ColdFusion Studio


Macromedia® ColdFusion® MX Development by Eric Ladd


http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?ColdFusion



http://www.webopedia.com/TERM/C/Cold_Fusion.html



http://www.macromedia.com/software/coldfusion



ColdFusion MX and the J2EE Architecture White Paper.
http://www.macromedia.com/software/coldfusion/whitepapers/
pdf/6_1/cfmx61_j2ee_arch_wp.pdf
.


26

Q&A