Introduction

cheap cialis pill certified cialis cheap viagra in canada cialis buy drug buy generic cialis viagra buy 25mg viagra cheap viagra without prescription buy cheapest viagra on line purchase viagra cialis 10mg buying generic viagra cialis pills viagra from india cheapest sildenafil citrate cheap cialis no rx viagra india cialis bangkok viagra for order buy sildenafil internet buy generic viagra online buying cialis online where to order cialis tablet cialis find cialis no prescription required viagra cheap drug order cialis cheap online online pharmacy cialis cialis no rx order generic cialis price of cialis viagra soft drug viagra cheap viagra from uk order cialis no prescription order cheap viagra viagra drug order cheap cialis cheap cialis pharmacy best price for viagra cheap viagra from usa cost cialis cialis overnight shipping cheapest generic cialis online generic viagra online online viagra viagra sales cheap cialis in canada compare cialis prices online cialis online drug viagra online purchase discount cialis without prescription no rx viagra cialis overnight viagra uk cialis order cheap cialis from usa buying cialis cialis overnight delivery cialis in bangkok buy and purchase sildenafil online impotence treatment cheap price viagra viagra sale cheap cialis tablet drug cialis generic cialis online cheap viagra pharmacy find discount cialis online viagra malaysia cialis without a prescription buy cialis online cheap viagra rx buy no rx viagra cialis 20mg viagra in malaysia discount viagra online buy sildenafil cheap buy viagra low price buy cialis cialis cheap price cialis cheap generic viagra cialis canada low cost viagra buy cheap viagra cialis vs viagra order cialis from us cialis tablets find no rx cialis buy generic cialis online buy viagra overnight delivery cheapest cialis price buy cheapest cialis on line order cialis in canada viagra tablet viagra no online prescription find cheap cialis online viagra price order viagra no prescription cheap generic cialis buy viagra online cheap cialis uk cialis without rx generic cialis cheap viagra vs cialis order cialis on internet viagra tablets viagra purchase impotence drugs buy cialis generic cialis tablet cialis cheapest price order viagra from canada viagra generic cheap viagra from canada order cialis compare viagra prices online find cheap cialis impotence cure pfizer viagra find discount cialis cheapest cialis buy cialis from india impotence buy cheapest viagra online cialis side effects viagra order discount cialis online cialis in malaysia cialis in uk viagra in uk cialis online without prescription cialis online pharmacy order viagra buy viagra online viagra side effects cialis sale discount cialis no rx cheapest viagra find cialis order cialis no rx buy cialis low price buy viagra cheap drug cialis online purchase order discount viagra online 50 mg viagra 100 mg viagra 10mg cialis cost of cialis cheapest cialis prices buy discount viagra online cialis sales 50mg viagra cialis price buy viagra on internet cialis pill cheapest cialis online purchase viagra overnight delivery cheap cialis from canada cheapest viagra price cialis 20 mg buy sildenafil low cost order viagra without prescription buy viagra lowest price no prescription cialis order viagra on internet discount cialis overnight delivery cialis cheap drug viagra approved viagra no rx required compare viagra prices no rx cialis cheap cialis on internet buy viagra from india buy discount cialis online viagra pharmacy online order viagra from us cialis free delivery cialis for order buy cialis from canada viagra without rx viagra online review 10 mg cialis cheap viagra no rx cheapest viagra prices viagra prices cialis pharmacy order no rx cialis buy cialis in us buy cialis no prescription required order cialis from canada lowest price cialis cheap cialis internet online pharmacy viagra cheapest generic cialis generic drugs cialis india find cialis without prescription best price cialis buy viagra without prescription cheap cialis in uk where to buy viagra 20 mg cialis cheap cialis from uk buy sildenafil canada cialis no rx required cialis in us buy cialis overnight delivery cialis cheap price order cheap viagra online 20mg cialis buy cheap viagra online viagra internet viagra without prescription free cialis buy cialis us cialis buy buy viagra in canada order viagra cheap online find viagra without prescription viagra pills cheap cialis no prescription viagra online without prescription order generic viagra cialis discount viagra cheapest price purchase viagra no rx viagra no rx viagra cheap discount viagra overnight delivery sale cialis cialis pharmacy online purchase cialis without prescription pharmacy online cialis medication discount viagra buy cheap cialis impotence medication viagra medication find cialis on internet impotence pills cialis prices discount viagra without prescription cialis online cheap cialis online review find cheap viagra online buy viagra us purchase cialis online certified viagra where to order viagra buy cheapest viagra buy cialis internet order cialis online buy sildenafil online buy cialis cheap cheap viagra purchase cialis find discount viagra buy cialis on internet cialis buy online buy sildenafil online without a prescription viagra buy online order cheap cialis online viagra information no prescription viagra cost of viagra buy cialis in canada buy cialis online buy viagra cheapest generic viagra cialis us cialis australia fda approved cialis lowest price for viagra viagra bangkok cialis prescription cialis cost buy no rx cialis buy viagra internet viagra discount order viagra overnight delivery generic cialis viagra australia 25 mg viagra order viagra online viagra overnight cialis rx order cialis in us order viagra no rx order discount cialis online viagra vendors order viagra in us buy sildenafil in uk viagra us buy generic viagra viagra canada viagra no prescription viagra cheap price cheap viagra tablet viagra free delivery overnight viagra purchase viagra online find cheap viagra cialis malaysia best price viagra cialis free sample find viagra on internet cialis generic buy sildenafil in canada order cialis no prescription required cheapest viagra online purchase cialis no rx viagra in us order discount cialis cheap viagra internet free viagra cialis approved best price for cialis cialis from india find no rx viagra generic viagra viagra from canada viagra online pharmacy buy viagra from canada cheapest generic viagra online buy cheapest cialis discount cialis viagra overnight delivery cialis without prescription 100mg viagra cialis in australia price of viagra order cialis overnight delivery cheap viagra in uk buying generic cialis viagra pill buy cialis on line low cost cialis find discount viagra online buying viagra cheap cialis overnight delivery pharmacy cialis cheap viagra pill viagra prescription find viagra online buy cialis lowest price discount viagra no rx online cialis viagra free sample cheap viagra in usa find viagra cheap viagra online buy viagra no rx generic viagra cheap buy cialis without prescription buy viagra in us cheap viagra overnight delivery cheap cialis in usa cheap cialis online viagra order no rx viagra viagra soft tab find cialis online lowest price viagra cialis drug cialis vendors viagra online stores erectile dysfunction order viagra in canada buy viagra on line viagra overnight shipping viagra online cheap lowest price for cialis approved viagra pharmacy cialis 10 mg cialis no online prescription cialis purchase cialis from canada order cialis without prescription viagra for sale viagra in australia approved cialis pharmacy buy viagra generic buy sildenafil in spain find viagra no prescription required cialis no prescription buy viagra from us order viagra no prescription required cost viagra purchase viagra without prescription buy cialis no rx cialis cheap cialis internet tablet viagra cheap viagra on internet viagra cost pharmacy viagra cialis soft tab cialis information buy cheap cialis internet purchase cialis overnight delivery cheap cialis without prescription buy viagra no prescription required compare cialis prices buy cheap cialis online overnight cialis where to buy cialis cheap cialis buy cheap viagra internet buy discount cialis viagra buy drug cheap viagra no prescription buy sildenafil citrate buying viagra online buy discount viagra fda approved viagra cialis online stores cheap cialis tablets buy cheapest cialis online cheap viagra tablets order discount viagra sale viagra viagra online cialis for sale cialis soft viagra pharmacy buy cialis from us viagra without a prescription viagra in bangkokJava is an object-oriented programming language developed by Sun Microsystems that has proven itself in numerous projects. The Java Platform is hardware and operating system independent and comes in three editions: Micro Edition for PDAs and cell phones; Standard Edition for computer programs; and Enterprise Edition for distributed, transactional, and portable applications.

Thursday, August 19th, 2004 at 10:23 am

ColdFusion vs. Java

I started working for msg at.NET and my first task was to rewrite an old ColdFusion application using the Mach II Framework. This was mainly done for comparison reasons, to see if it would pay off doing projects with Mach II. Because I am a little bit into Java, and Java is definitely my favourite programming language so far, I offered expand the little research and compare these two ColdFusion applications with a Java solution. The Java solution was programmed using the Spring Framework, a light-weight Java container.
Download the application for ColdFusion and Java (note that this is not the original program I had to convert but a simpler one).
The first thing I encountered was that writing an application in Java is as easy as writing it in ColdFusion. So there is no difference in that spectrum. This is at least true for someone that knows some basics about Object-Oriented Programming.
When comparing the two solution directly there is no question that the application written in Java is more flexible and easier to maintain. This is achieved due to the use of Java’s great language features like interfaces, abstract classes and type checking combined with good practices like inversion of control.
It is no problem to switch from one database to another or even change the database type. These changes have no effect on the underlying code. These capabilites also make testing easier. You can easily write stub implementations or mocks to test the application without the need to set up a database.
The changes can be made without redeploying the whole application. All important settings can be done declaratively in xml files.

As you can see there are nearly no restrictions or functionalities missing what is not true for the ColdFusion solution. So let’s take a closer look at it.

Because of the help of the Mach II Framework our control-flow is now managed in one file, mach-ii.xml. While this is a great thing there are some declarative options missing. It is said that listeners shall only be used as facades to let business logic not depend on the framework. But there is no possibility set up a reference to these framework independent components, declare basic properties like the name of the database and reference these components in the listeners.
The control-flow shall be handled in the event-handlers. But because no simple if-else statements can be declared, some logic has to be moved into listeners. This produces mishmash of event-handler and listener managed control-flow logic.
Another problem for a programmer who knows what listeners, events and event-handlers are is the naming. For example listeners that should be nontransparent for event-handlers are this not at all. The event-handler even decides which method to call on the listener and where to store the result. An even-handler is a on xml-basis declared method that handles the control-flow.
A disadvantage is also the, at least for me scaring, tag-based object-oriented scripting language. As well as the fact of bad type checking, the inability to use interfaces and other useful object-oriented constructs.

This is at least my experience so far. So, my question is, why are people working with ColdFusion?

6 Responses to “ColdFusion vs. Java”

  1. Vui Lo

    Here are things I noticed in your arguments which I think should be made clear:
    1. you’re comparing frameworks not languages. 2. Mach-II is an MVC only framework while Spring is an application framework which provides management of MVC, transaction, and application context. NOTE: application context and transaction support are provided by ColdFusion out of the box.
    3. both Mach-II and Spring promotes good programming practices
    4. tag-based scripting is more natural in the presentation tier than any other programming implementation, otherwise why do we have JSP tag libraries? The same trend happens in Rich Client development.

  2. Simon Wacker

    1. Yep, I am probably mixing the comparison of frameworks with programming language comparison.
    2. Know that too. But Spring is also offering support for MVC in the presentation tears. And I think the two can be compared.
    3. Also right. ;) 4. I fully agree. But in my eyes a coldfusion component does not have much to do with presentation. Neither do database queries.

  3. dave ross

    “But there is no possibility set up a reference to these framework independent components, declare basic properties like the name of the database and reference these components in the listeners.”

    Confused about this one… did you look at the property manager?

  4. Craig M. Rosenblum

    Simply, because ColdFusion is a markup-language, that has a more naturual and logical flow.

    ColdFusion is reknown for it’s rapid application development. Speed of idea to completion.

    Java is much more detailed, takes longer, costs more in developers.

    Although ColdFusion code can be done wrong, but if planned, organized, documented thoroughly, they can create efficient applications.

    Coldfusion is also much easier to learn, if you know HTML, you can easily learn ColdFusion.

    If you need to show some code to your boss, to make sure it follows his business rules, it’s easy for anyone to read to follow the logic. With Java that is nearly impossible, because of the object-orientation.

    Having frameworks is nice, as long as they are not oop frameworks.

  5. Paul Kenney

    Simon,

    I second Dave about looking at the PropertyManager. This object holds all the values defined in the “properties” section of the configuration file, and it is available to any components that extend the framework (event handlers, plugins and filters) for both reading and writing new and existing properties at runtime.

    “But because no simple if-else statements can be declared, some logic has to be moved into listeners. This produces mishmash of event-handler and listener managed control-flow logic.”

    If you haven’t already, take a look at filters. In general, they control the conditional flow of login in the request. They can access the eventContext and clear the event queue, stop the execution of the current event, announce new events, display/call views, and any other processing that is secondary to core business logic in the application.

    They are commonly used as a means of interacting with HTTP specific things like cookies, http headers, request scope, client scope, cgi scope and more. Filters are also used to facilitate data persistence, authentication and authorization, and i18n.

    Really, listeners can do this, but many times filters can do a better job of isolating the business layer from the controller and the presentation layers. Also if there is something that MachII doesn’t do, but is essential for your application, you can write a filter that essentially extends the utility of the framework. Filters are the declarative equivalent of custom tags in a runtime environment.

    Something elso that you did not mention is the plugin. This is very handy for pre- and postprocessing of the request, its events, views, unchecked exceptions, and application initialization.

    “As well as the fact of bad type checking, the inability to use interfaces and other useful object-oriented constructs.”

    Actually, if you use CFCs with tag-based functions, you can utilize all sorts of runtime type checking of both built-in types as well as components for method return types and parameters. As far as interfaces go, there is a lot that can be done without having to use them. Sure they make many designs easier to implement–especially if you are familiar with all the Java-centric literature regarding patterns–their absense doesn’t make them any less possible. There are many other languages that do not support interfaces such as Smalltalk which is considered by many to be the purest form of OO around.

    “…there is no question that the application written in Java is more flexible and easier to maintain.”

    This is very often said of CFML as well… I guess it depends on where you’re coming from.

    Anyhow, I am glad to see that you tried MachII and even went on to see how it compared to a Java implementation.

    I’d be interested to see if you would be interested in revisiting your Mach-II implementation and find places where you could move code out of your listeners and into filters. Also, take a look at using the PropertyManager for getting/setting properties at runtime from within your listeners and filters(if any). A couple of tags that will help decouple listeners from the control-flow are “event-mapping” and “event-arg”.

  6. Simon Wacker

    First of all, thanks for all the helpful responses.
    I actually used the PropertyManager in the sample application that stays for download. I used it to get the string path to the framework independent DAOs. But these are as said only string paths and not instantiated components one can use directly. I have to instantiate them first and set a few basic properties. It would be cool if this instantiation could be done automatically and if the component dependent properties could be set via the xml file (not global properties).
    I am also already using filters for login validation.
    The if-else problem was related to a component that made database queries and originally returned true or false depending on success or failure. And I just would have liked to make the if-else check in the event-handler. A filter is not appropriate in this specific case.