Coldfusion Programming Language

0 views
Skip to first unread message

Nhyiraba Valentin

unread,
Aug 4, 2024, 3:26:20 PM8/4/24
to lmensouthreca
ColdFusionis an application server. ColdFusion is also a web programming language that allows a web application communicate with various back end systems. Using ColdFusion, you can create dynamic web pages that offer user input, database lookups, time of day, or any other criteria you require. ColdFusion pages consist of standard HTML, together with its proprietary ColdFusion Markup Language (CFML).

The ColdFusion Application Server is the program that actually parses and processes all given instructions. These instructions are in the form of templates. A template in ColdFusion contains special tags that instruct ColdFusion to perform certain operations.


With every installation of ColdFusion, a built-in web server also gets installed. To avoid conflict with other web servers, ColdFusion's web servers (Apache or IIS) runs on port 8500 or any other specified port.


During ColdFusion installation, you can either opt to run ColdFusion in stand-alone mode (bound to the integrated Web server) or using an existing Web server. If you opt to use the internal Web server, specify the port number in all URLs.


ColdFusion Markup Language (CFML) is the scripting language used by ColdFusion. CFML supports standard HTML files with database commands, conditional operators, high-level formatting functions, and other elements to produce web applications.


ColdFusion tags have the same format as HTML tags. They are enclosed in angle brackets and can have zero or more named attributes. Many ColdFusion tags have bodies, that is, they have a start and end tags with text to be processed between them.


ColdFusion Markup Language, more commonly known as CFML, is a scripting language for web development that runs on the Java virtual machine (JVM), the .NET framework, and Google App Engine. Several commercial and free and open-source software implementations of CFML engines are available, including Adobe ColdFusion, Lucee, New Atlanta BlueDragon (Java and .NET versions), Railo, Open BlueDragon, and other CFML server engines.


In its simplest form, like many other web scripting languages, CFML augments standard HTML files with database commands, conditional operators, high-level formatting functions, and other elements to produce web applications.[1][2] CFML also includes many other constructs including ColdFusion Components (CFCs), CFML's version of objects, that allow separating business logic from presentation.


The pages in a CFML application include the server-side CFML tags and functions in addition to HTML tags. Modern CFML applications also tend to have CFCs that are accessed by the CFML pages for executing business logic. When a web browser requests a page in a ColdFusion application, it is automatically pre-processed by the ColdFusion application server.[3]


The CFML engine is configured in such a way that certain file extensions on the server (.cfm, .cfc) are handed off to the CFML engine for processing. In the case of the Java-based engines this is accomplished via Java servlets. The CFML engine only processes CFML tags and functions; it returns text outside of CFML tags and functions to the web server unchanged.[4]


Named Cold Fusion at the outset, the software was created in 1995 by the Allaire Corporation, originally located in Minnesota. It later moved to Cambridge, Massachusetts and then finally to Newton, Massachusetts before being acquired by Macromedia in 2001. Allaire Cold Fusion thus became Macromedia Cold Fusion. At the release of version 4, the space in the name was removed to become ColdFusion. Adobe acquired Macromedia in 2005. As of 2023[update], it is still actively developing ColdFusion.


In 1998 Alan Williamson and his Scottish company, "n-ary", began creating a templating engine for Java to simplify common programming tasks.[5] Williamson was using curly-brace notation instead of tags, but when he saw an example of CFML and how it was solving similar problems (although not in Java) using a tag syntax, he started developing what would eventually become BlueDragon, which was the first Java implementation of the CFML language. (ColdFusion was written in C and C++ until version 6.0, the first Java-based version, was released in 2002.) New Atlanta licensed BlueDragon around 2001 and made it available as a commercial product, eventually creating a .NET implementation of CFML. Open BlueDragon is a fork of the commercial BlueDragon product and was first released in 2008.


The Railo CFML engine began as a student project in 2002 and was first launched as a commercial project in 2005.[6] Railo announced they were making the engine open source in 2008, and the first open source version was released in 2009.


On June 18, 2009, Adobe announced at the CFUnited conference that it had formed a CFML Advisory Committee[7] that would be responsible for guiding and reviewing changes to the CFML language. This effort was disbanded in 2010. The Google Group CFML Conventional Wisdom was created as a forum for open, public discussions about language and engine features; its use has dwindled since 2011.[citation needed]


Former Railo lead developer Michael Offner launched Lucee, a fork of Railo, in London on January 29, 2015. Backed by community supporters and members of the Lucee Association, the goal of the project is to provide the functionality of CFML using fewer resources, giving better performance and to move CFML past its roots and into a modern and dynamic Web programming platform.


CFML tags have a similar format to HTML tags. They are enclosed in angle brackets () and generally have zero or more named attributes, though some tags (e.g. cfset, cfif) contain an expression rather than attributes. Many CFML tags have bodies; that is, they have beginning and end tags with text to be processed between them. For example:


Other tags, such as cfset and cfftp, never have bodies; all the required information goes between the beginning () character in the form of tag attributes (name/value pairs), as in the example below. If it is legal for tags not to have a body, it is syntactically acceptable to leave them unclosed as in the first example, though many CFML developers choose to self-close tags as in the second example to (arguably) make the code more legible.


Even if the tag can have a body, including a body may not be necessary in some instances because the attributes specify all the required information. In these cases, as with the second example above, the end tag (and hence, the tag body) may be omitted and the tag may be self-closing as in the following example:[8]


Various tags offer the ability to type-check input parameters (e.g. cffunction, cfparam, cfqueryparam) if the programmer declares their type specifically. This functionality is used with cfqueryparam to secure web applications and databases from hackers and malicious web requests such as SQL injection.


CFML allows language extensions in the form of custom tags, which are tags created by the developer that are not part of the CFML language itself. Custom tags are regular CFML files which are intended to be invoked as tags, although it is possible to treat a template as both a custom tag and a regular template. Custom tags are written in CFML and are typically invoked by prefixing the custom tag's file name with cf_, although there are other ways to invoke custom tags.


If a template is invoked as a custom tag, the attributes used to invoke that tag are available within the tag in an attributes scope and the variables for the calling page are accessible via the caller scope.


CFX tags are custom tags which are developed using Java or C++, and are prefixed with cfx_ just like cf_. Java and C++ tags are added to the CFML runtime environment using the CFML engine's administrator or by editing configuration files.


CFCs can be used in various ways. If a method contained in a CFC simply needs to be invoked, the tag will create an instance of the CFC, invoke the desired method, and then destroy the instance of the CFC. takes the name of the component (minus the .cfc extension) and the method to execute. To access any returned data, the RETURNVARIABLE attribute provides the name of a variable to contain whatever the function returns.CFCs are created using four tags, saved as .CFC files, and invoked using the tag.[28]


In the example below, component temperature.cfc has a method FtoC which converts temperature from Fahrenheit to Celsius. The test.cfm template invokes the method and converts 212 degrees Fahrenheit and outputs the result.


CFCs also form the basis of the ability to create web services in CFML. A CFC is created in the usual way, and the attribute access="remote" added to any function within the CFC will make that function available to be called as a SOAP-based web service. The CFML engine auto-generates a WSDL and creates all the necessary stubs for the web service to function.


Over time, the efficiencies and peace-of-mind which come with using ColdFusion offers a spectacular return on investment. Better-equipped developers and operations teams testing products in real time can turn projects around at a faster pace. Lower odds of mistakes mean less time troubleshooting. And security? It pays for itself.


This is often a major concern for CIOs. A hack could compromise user. Company data is at risk. Larger firms face even bigger consequences. Some can even be held for ransom, or seen data sold off to other shady characters.


It does this through a tag-based system. Whereas other languages require a jerry-rigged system to manage its various functions and components, before moving to CFScript, CFML used tags as a shorthand for commonly-used tools. This means a fraction of the keystrokes and much less time creating something that already exists.


Naresh even foresees a future where companies keep bits of their applications and IT operations scattered across several cloud providers. Maybe the ID check portion of your web application will be on a cloud provider who has a good reputation for security, while your database will be on a provider with lots of storage at a reasonable price.

3a8082e126
Reply all
Reply to author
Forward
0 new messages