Adobe ColdFusion (ColdFusion Markup Language-CFML) is a commercial rapid web application development platform created by JJ Allaire in 1995.
ColdFusion is a development platform for build web applications. It’s build and designed to be expressive and powerful.
ColdFusion allows you to perform programming tasks at a higher level than most other languages.It gives you opportunity for
integration with database, mail exchange, documents creation and more.
ColdFusion is built on Java and uses the Apache Tomcat J2EEE container. ColdFusion files use extension “.cfc” for objects and “.cfm” for pages.
In ColdFusion data is held in variables. You can stick any kind of data into a ColdFusion variable without having to tell ColdFusion what kind of data it is.
This is just one of the good sides of ColdFusion.
Syntax of ColdFusion is similar to HTML (HyperText Markup Language). It’s based on tags and every tag have beginning and end tags with some
code to be processed between them.
Here’s the simplest code to set a variable:
<cfset greeting= “Hello”>
When you set data to variable, any time when you refer to that variable it will hold te data.
You can look at the contents of variable by using cfdump tag or you can print contents by using cfoutput tag.
<cfdump var = “#greeting#” />
<cfoutput>#greeting#</cfoutput>
ColdFusion has been designed to allow the use of ColdFusion tags and ColdFusion script.
Functionally, both will be interpreted equally and will achieve the same result.It’s personal choice e what are you going to use.
<cfscript>
variable = “Hellooooo”;
writeOutput(variable);
</cfscript>
Nearly 100 built-in tags and many more functions make up the heart of the CFML language.
Some of the main features are:
-Database access
-Server clustering
-Server, application, client, session, and request scopes
-XML and JSON parsing
-Conversion HTML to PDF
-Caching
-Simplified web service implementation
ColdFusion allows you to create a Component(CFC) as well as to include separate scripts.
CFC provide some of the typical features and functionality that are provided by object-oriented programming languages (OOP).
If you want to create a component you have to create file with .cfc extension and use for tags.
<cfcomponent>: Defines a CFC
<cffunction>: Defines the functions (methods) within a CFC
<cfargument>: Defines the arguments (parameters) that a function accepts
<cfreturn>: Returns a value or result from a function
Example:
<!— temperature.cfc —>
<cfcomponent>
<cffunction name=”FtoC” access=”public” returntype=”numeric”>
<cfargument name=”fahrenheit” required=”yes” type=”numeric” />
<cfset answer= (fahrenheit – 32)*100/180 />
<cfreturn answer />
</cffunction>
</cfcomponent>
<!— test.cfm —>
<cfset fDegrees = 212 />
<cfinvoke component=”temperature” method=”FtoC” returnvariable=”result”>
<cfinvokeargument name=”fahrenheit” value=”#fDegrees#” />
</cfinvoke>
<cfoutput>#fDegrees#°F = #result#°C</cfoutput> <br />
The latest version of ColdFusion is released in February 2016.