Education Online for Computer Software, Web Development, and Microsoft Office
Home  ->  Learn More About Web Dev, Software Applications, Microsoft Office, and Computers



Learn About Macromedia ColdFusion



 

In computing, ColdFusion is a tag-based, middleware programming language used chiefly for writing web-based applications. The language was created by JJ Allaire and his brother Jeremy Allaire, was subsequently purchased and owned by Macromedia for many years, and has been acquired by Adobe since May 2005.

The ColdFusion application server can be used alongside an existing HTTP server application such as Apache or IIS, or it can serve as its own limited HTTP server for development purposes.

ColdFusion is generally recognized to be the easiest rapid development language for people coming from straight HTML to learn. This is partly because it is tag based like HTML. User groups, listservs, conferences and the Fusebox and Mach-II methodologies for organizing ColdFusion code also helps new users getting started.

ColdFusion is a commercial product but is available as a free feature-complete "developer version" from the Macromedia.com website. This allows developers to run a local copy of the complete enterprise system for local testing.


Contents

Early days

Cold Fusion 1.0 was officially released on July 10th of 1995 by Allaire. The tag-based programming language used was called DBML (DataBase Markup Language) and was later renamed to CFML (ColdFusion Markup Language). Beginning with version 1.5, ColdFusion contained compatibility with C++, allowing users to develop extensions to the language. Years later, this would be the basis for ColdFusion Extension (CFX) Tags, a method of extending the ColdFusion language. Later versions of the language allowed extending the language by writing custom tags in Java and CFML itself. The product was also renamed ColdFusion (one word) - most likely to make it trademarkable - about this time. Starting in version 5.0, users could also define functions to extend the language (UDF = User Defined Function).

ColdFusion MX

Meanwhile, Allaire began work on rewriting the basis of ColdFusion with Java (codenamed "Neo"), which would allow for greater portability among different platforms.

On January 16, 2001, Allaire announced that it would be merging with Macromedia. Shortly after the merger, Macromedia continued with the incremental release of ColdFusion 5.0 and in June 2002, Macromedia released Macromedia ColdFusion MX, extending the naming convention of Macromedia's line of products. ColdFusion MX was completely rebuilt from the ground up and was based on the Java 2 Enterprise Edition (J2EE) platform. ColdFusion MX was also designed to integrate well with Macromedia Flash using Macromedia Flash Remoting MX.

Starting from the MX (6.0) release, ColdFusion is compiled to an intermediate format (bytecode), just like like JSP and ASP.NET. This allows those languages to execute faster on average than interpreted languages like PHP or ASP.

With the release of ColdFusion MX, the CFML language was also extended to support basic OOP. Apart from the tag-based CFML syntax, ColdFusion supports embedded scripts that can be written in a JavaScript-like language.


ColdFusion MX 7

With the release of ColdFusion 7.0, the naming convention was amended, rendering the product name "Macromedia Coldfusion MX 7". CFMX 7 added Flash based web forms and a report builder that outputs in PDF as well as Flash Paper and Excel. The PDF output is also available as a wrapper to any HTML page, converting that page to a quality printable document. The enterprise edition also added Gateways. (These provide interaction with such things as IM Services, SMS, Directory Watchers, and an asyncronious execution... or add your own gateways.) XML support was boosted in this version to include native schema checking. There are other features but it was a innovative release for the web technology world.


Alternative Server Environments

ColdFusion is a proprietary technology based on Web technology industry standards, however, it is becoming a less closed technology through the availability of a potentially competing product. Products include New Atlanta Blue Dragon, IgniteFusion , and Coral Web Builder.

More information about Blue Dragon can be found on their own listing. In addition to partial ColdFusion language support, BlueDragon also offers a free "developer version" that has certain limitations.

Acronym

The acronym for the ColdFusion Markup Language is CFML. When ColdFusion templates are saved to disk, they are traditionally given the extension .cfm or .cfc for ColdFusion Components. The original extension was DBM or DBML, which stood for Database Markup Language. When talking about ColdFusion, most users use the Acronym CF and this is used for numerous ColdFusion resources such as user groups (CFUGs) and sites (CFTips.com).

CFMX is the common abbreviation for ColdFusion versions 6 and 7 (aka ColdFusion MX).


Code example

Query your database:

<cfquery name="nameofquery" datasource="odbc_connection" username="simple" password="enough">
  SELECT * FROM table
  WHERE field = 'whateveryouaresearchingfor'
</cfquery>

Loop through your records:

<cfoutput query="nameofquery">
#nameofquery.field_from_query#   
<!---Above is called a variable, this text here is just comments --->
</cfoutput>

Set and display a variable:

<cfset sMyVar = "A Variable defined in CFML">
Here is the contents of the variable: <cfoutput>#sMyVar#</cfoutput>

Define and use a function:

<cffunction name="AddTwoNumbers" returntype="numeric" output="false" hint="I add two numbers.">
 <cfargument name="NumberOne" type="Numeric" required="true" hint="I am the first number.">
 <cfargument name="NumberTwo" type="Numeric" required="true" hint="I am the second number.">
 <cfreturn NumberOne + NumberTwo>
</cffunction>

<cfoutput>#AddTwoNumbers(2, 2)#</cfoutput>

Define a component (class):

<cfcomponent>
 <cfset variables.someproperty = "">
 <cffunction name="getSomeProperty">
  <cfreturn variables.someproperty>
 </cffunction>
 <cffunction name="setSomeProperty">
  <cfargument name="value" required="true">
  <cfset variables.property = arguments.property>
 </cffunction>
</cfcomponent>

Invoke a java class:

<cfset myPath = "C:\MyFile.txt"/>
<cfset myFile = CreateObject("java","java.io.File").init(myPath)/>
<cfset fis = CreateObject("java","java.io.FileInputStream").init(myFile)/>


Syntax

CFML provides two different syntax formats for you to use, each with their own pro's and con's.

Tag-based Syntax

CFML follows an XML/HTML-alike syntax in that all commands are written in the format:

<cfcommand argument="something">Some text</cfcommand>
<cfset variable="some data">

CFSCRIPT Syntax

An additional syntax format is available that is similar to Javascript:

<cfscript>
  command('argument 1', 'argument 2');
</cfscript>

This second format provides a cleaner migration path for people with experience in C-style languages: C, C++, Java, Javascript, etc. One thing to remember is that to use this syntax you must include the cfscript command around the code block-- you can't just launch into cfscript.


Development Aides

The following tools and frameworks are available:

Development Tools / Environments

Code Frameworks


External links

Retrieved from "http://en.wikipedia.org/wiki/ColdFusion"
Views
Personal tools
Navigation
Toolbox
In other languages

 

 

All text is available under the terms of the GNU Free Documentation License (see Copyrights for details).