Skip to content
 

ColdFusion Interview Questions Part 1

What are the main components of ColdFusion?

ColdFusion have the following main components:

ColdFusion admin, CFML (ColdFusion markup language), CF script, Variety search

 

What is the architecture of ColdFusion?

Presentation server (presentation layer), Application server, Web server and a database server.

It has a J2ee web container that is the base of ColdFusion environment. And a ColdFusion runtime environment that will interprets the ColdFusion requests, and a database server.

 

What are the main features of ColdFusion?

ColdFusion has many benefits over other web languages. The very first thing we need to discuss is, ColdFusion is the first web languages that has been developed to build web application (dynamic).

After ColdFusion, PHP, and Microsoft’s asp .net were in the market. PHP is free and so many small companies and individual entrepreneurs use it. So php is widely used compared to others because it is free. Microsoft’s asp .net is next to it for mid to big size organizations as it give good support and of course the brand name also does the magic. ColdFusion though it is the first language from the rest, because of lack of publicity and cost, it is still not widely used. But below are the main benefits of ColdFusion over others.

It is very easy to install and very easy to migrate from older version to new version.

It does support all operating systems.

It is very easy to learn because of its self explanatory code/tags.

Easy integration to other adobe products such as flex, adobe pdf, flash etc..

Good database support and works for all protocols.

 

What is the main difference between Coldfusion 5.0 and Coldfusion MX6.0?

New era started for ColdFusion from MX versions.. such as Mac, Linux support, Flash remoting new Variety search functionality and code and debug of flash components.

 

What are the advantages of ColdFusion 9 over older versions?

ColdFusion 9.0 has many benefits over older versions and to name few they are:

Coldfusion can be used as a service with out writing lines of code, we can get results by using: CFChart, Cfdocument, CFImage, CFmail, CFPDF and cfpop etc. And also these services can be sandboxed in order to give more security.

Adobe AIR database synchronization.

New AJAX controls are added.

Server manager is a new feature by which from one access point we can manage several admin tasks of various servers.

Also ColdFusion 9 allows you to create coldfusion component as a portlet.

 

What is an Application.cfm page and why it is used? Is it mandatory? How many application.cfm pages we can use in a coldfusion application?

Application.cfm page will be used to define application level variables, for example instead of declaring dsn variable in every query you use, you can define the variable in application.cfm page once and can use that variable in every ColdFusion page you use queries to retrieve data from database.

We can definitely use more than one application.cfm pages, however, only the first application.cfm page that the ColdFusion server finds, will be used.

Application.cfm page is not mandatory.

 

What are the important components of Application.cfm page?

Name, clientStorage, LoginStorage, ClientManagement, ApplicationTimeout, SetclientCcookies, SessionTimeout etc..

 

How to use ClientManagement in application.cfm page? Give an example

ClientManagement can be enabled and disabled as and when we need depending upon the requirement.

  1. In the Application.cfc initialization code
    This.clientmanagement=”True” / “false”
    This.clientStorage=”[Ur_datasource_name]” / “registry” / “cookie”
  2. In appliation.cfm using <cfappliaction> tag attributes
    clientManagement=”yes”  / “no”
    clientStorage=”[Ur_datasource_name]” / “registry” / “cookie”
    [Ur_datasource_name] – Stored in ODBC or native data source. You must create storage repository in the Administrator.
    registry – Stored in the system registry.
    cookie – Stored on client computer in a cookie. Scalable. If client disables cookies in the browser, client variables do not work.

 

 

What are the different variable scopes in ColdFusion? Explain in brief?

Scope

Description

Variables

These are local variables. These variables can not be used in custom tags

Attributes

These variables are used in custom tags.

Caller

Caller is used in the custom tag to read or to set with in template that is being called.

Arguments

Arguments are used in coldfusion functions.

This

It is used within the component.

Request

It is used for the current request.

CGI

CGI refers to the current request environment. These are read only.

Form

These variables are submitted through form using post.

URL

These are passed through URL.

Server

These are server level variables that are available for all applications in the server.

Application

These are application lever variables. Available throughout the application.

Session

These are available only for the current users session.

Client

Client variables are stored in the server registry or database.

Cookie

These are global variables. These are stored in the users machine.

 

How to upload a file using Coldfusion?

By using cffile tag, we can upload a file to the server.

A typical cffile syntax is:

<cffile action=”upload”

fileField=”fileUpload”

destination=”C:docs”>

 

What is Query of Queries? What is the use of Query of Queries?

Coldfusion has a beautiful feature called Query of Queries which is mainly used for improving performance of the application.

Query of Queries is the result of an existing database query result.

This will be done by using coldfusion “cfquery” tag and need to specify dbtype = ‘query’.

Eg:

<cfquery dbtype="query">
select *
from NameOfAnotherQuery
where ColumnName = 'SomeValue'
</cfquery>

 

How to you debug a Coldfusion program?

Coldfusion provides us many debugging options in order to trouble shoot a coldfusion program.

The important are:

CFDUMP,  eg: <cfdump var="#abcd#">

 

CFABORT, eg:  <cfabort>

On the debugging settings in coldfusion administrator. (you will see the lengthy debugging information at the bottom of the coldfusion result).

 

Can you explain Get file & Put file ? (coldfusion FTP – <cfftp>)

By using coldfusion <cfftp> tag, we can send data from local computer to the server and also retrieve the data from server to the local computer.

By using Get file, we can retrieve data from server:

<cfftp
        action="getFile"
        server="127.0.0.1"
        username="user1"
        password="pass1"
        remotefile="/abcd.jpeg"
        localfile="C:examples/efgh.jpg"
failIfExists="no">

 

By usingPut file, we can send data to the server:

<cfftp
        action="putFile"
        server="127.0.0.1"
        username="user1"
        password="pass1"
        localfile="C:examples/efgh.jpg"
        remotefile="/abcd.jpeg"
failIfExists="no">

 

How error handling is handled in Coldfusion?

While debugging is mainly used to debug the code and to see run time values. Especially for trouble shooting. How ever, once the programs are in production server, we can not debug, but to avoide users seeing all the error messages when a program unexpectedly failed and throwing errors, we can use error handling methods.

TRY and CATCH is the best among them to handle any database related errors.

<cftry>

Here is your actual code…of coldfusion….

<cfcatch>

Write your message  to the user in case of any error.

</cfcatch>

</cftry>

 

i.e basically we are packaging our code using cftry and cfcatch tags.

 

What is the structure of a CFC ?

<cfcomponent>  
     <cffunction>
         <cfargument/>
         <cfargument/>
         <cfargument/>
         </cffunction>
</cfcomponent>

 

Can you give an example of a coldfusion component (cfc)?

<cfcomponent>  
     <cffunction access="public" output="false">
        <cfargument required="true"/>
        <cfargument required="true"/>
     <cfquery datasource="SecurityDB">
        SELECT username
        FROM Security
        WHERE username = (#arguments.user#)
        AND password = (#arguments.passwd#)
     </cfquery>
   </cffunction>
</cfcomponent>

 

How many ways a Coldfusion components are called or invoked? (CFC)

  1. A) By uing cfinvoke :
<cfinvoke 
         component="security" 
         method="authenticate" 
         returnVariable="authenticated" 
         user="#form.username#" 
         passwd="#form.password#"
 >

 

  1. B) By using CFscript tag:
<cfscript>
            objSecurity = createObject("component","security");
            bAuthorized = objSecurity.authorize(form.user,form.groupID);
</cfscript>

 

And other ways of calling a coldfusion component:

C direct URL

D form post

E Macromedia Flash movies through Macromedia Flash MX and Flash Remoting

F as a web service (with auto-generating WSDL)

 

 


coldfusion interview questions coldfusion 9 interview questions

Leave a Reply