Migrating From ColdFusion To ASP NET
Migrating From ColdFusion To ASP NET
NET
Architecture Comparison
• ASP.NET is based on Microsoft's .NET Framework. At runtime, all ASP.NET pages are
parsed and converted into source code for a .NET-compatible language (usually
Microsoft Visual Basic® .NET or C#) and then compiled into Microsoft Intermediate
Language (MSIL), a processor-independent bytecode with many similarities to Java
bytecode. This MSIL is then further just-in-time compiled into native machine code before
being executed. After the initial compilation, the cached native machine code for a page
is re-executed without the need for further parsing or compilation.
• Although the low-level frameworks underlying each system cannot be ignored, the most
striking differences between ColdFusion MX and ASP.NET that many Web developers will
notice occur at a much higher level—in the development and page execution models.
While the details vary, ColdFusion follows the same development and page execution
model as that of classic ASP, PHP, JSP, and other similar Web-scripting languages.
Specifically, code is embedded in HTML markup, and as a given page executes from top
to bottom, the output of the code's execution takes the place of the embedded code in the
resulting HTML document.
• This development model is easy to grasp, but it does have a number of drawbacks. Chief
among these is the lack of separation between application logic and presentation
markup. Mixing code and presentation makes the code harder to read, which increases
the time and effort involved in maintenance, and creates significant challenges for non-
programming graphic designers who need to modify a page. Over the years, ColdFusion
has introduced several ways to mitigate this lack of separation, including custom tags,
and others—but the fundamental model remains.
• ASP.NET, however, makes a very distinct break from the traditional model of Web
application development. Rather than being linear and page-oriented, ASP.NET code is
strongly typed, object oriented and event based. Basically, ASP.NET development is a
blending of traditional Web development and traditional fat-client GUI development. Page
elements are represented on the server-side by objects, each with its own properties,
methods and events.
• An example is a page that posts back to itself and inserts some information from a form
into a database. In ColdFusion, you might write some code to check for the existence of a
form variable corresponding to the name of the HTML submit button to see if the page is
loading for the first time, or as the result of a form submission. Then you would read the
various form variables, validate them, and perform a database insert. If one or more form
variables failed validation, you would need to write more code to display an error
message to the user and to preserve the values the user has already entered.
• In ASP.NET, you simply bind a function to the Click event of a Button server control.
Within this function, some code will read the Text property of the various form fields,
represented on the server-side with TextBox objects. By the time the button's Click
event has fired, form field validation has already been performed by any validation
controls on the page, which also take care of displaying any necessary error messages to
the user. Each individual TextBox takes care of preserving its own contents in the event
users need to edit one or more of their entries.
• Performance is also much better on asp.net. Pages that took 300 to 1500 ms on
coldfusion take 20 to 100ms (at most) in asp.net. Rarely do I see many asp.net pages
that take over 20ms to process.
• ASP.NET apps have better chance of surviving application life cycles because of better
encouraging of separation between presentation and business logic.
Whereas most of the CF apps mix it inline on the page, producing spaghetti code... easy
to create, hard to maintain.
What is ColdFusion?
• ColdFusion is the hot way to create dynamic webpages that link to just about any
database.
• ColdFusion is a programming language based on standard HTML (Hyper Text Markup
Language) that is used to write dynamic webpages. It lets you create pages on the fly
that differ depending on user input, database lookups, time of day or whatever other
criteria you dream up! ColdFusion pages consist of standard HTML tags such as <FONT
SIZE=.+2.>, together with CFML (ColdFusion Markup Language) tags such as
<CFQUERY>, <CFIF> and <CFLOOP>. ColdFusion was introduced by Allaire in 1996,
acquired by Macromedia in a merger in April 2001, and acquired by Adobe in December
2005. It is currently in version 7.0.1, but the next version of the product (codenamed
Scorpio) is already in development.
Early versions
The first version of ColdFusion (then called Cold Fusion) was released on July 10, 1995. This first
version was written almost entirely by one person, JJ Allaire. Primitive by modern standards, early
versions of ColdFusion did little more than database access.[1]
All versions of ColdFusion prior to 6.0 were written using Microsoft Visual C++. This meant that
ColdFusion was largely limited to running on Microsoft Windows, although Allaire did successfully
port ColdFusion to Sun Solaris starting with version 3.1.
Releases
1995 Allaire Cold Fusion version 1.0
1996 Allaire Cold Fusion version 1.5
1997, Jun Allaire Cold Fusion version 3.0
1998, Jan Allaire Cold Fusion version 3.1
1998, Nov Allaire ColdFusion version 4.0 (space eliminated between Cold and Fusion to make it
ColdFusion)
1999, Nov Allaire ColdFusion version 4.5
2001, Jun Macromedia ColdFusion version 5.0
2002, May Macromedia ColdFusion MX version 6.0
2003, Oct Macromedia ColdFusion MX version 6.1
2005 Macromedia ColdFusion MX 7
2007, July 30 Adobe ColdFusion 8
2007, Ongoing Adobe ColdFusion 8 Updater 1 (aka ColdFusion 8.0.1) currently under
development - due early 2008.
• A unique feature for a J2EE vendor, ColdFusion 8 offers the ability to access .NET
assemblies remotely through proxy (without the use of .NET Remoting). This allows
ColdFusion users to leverage .NET without having to be installed on a Windows
operating system.
• The move to include .NET support in addition to the existing support for Java, CORBA
and COM is a continuation of Adobe ColdFusion's agnostic approach to the technology
stack. ColdFusion can not only bring together disparate technologies within the
enterprise, but can make those technologies available to a number of clients beyond the
web browser including, but not limited to, the Flash Player, Adobe Integrated Runtime
(AIR), Mobile devices (SMS), Acrobat Reader (PDF) and IM gateways.
Summary
A migration from ColdFusion to ASP.NET can be as simple or as complex as it needs to be. Your
migration could be a straightforward port of existing functionality or a complete rewrite that takes
full advantage of ASP.NET's advanced features. Nearly every feature present in ColdFusion has
an equivalent in ASP.NET, which facilitates a straight port that requires very little effort beyond
basic syntax translation. However, if time constraints allow, a re-examination of the application's
architecture (in light of ASP.NET's unique capabilities), can lead to a significant improvement in
the application's performance, scalability and functionality.