- ColdFusion Is Easy to Learn
- ColdFusion Is Popular and Cost-Effective
- Professional or Enterprise?
- CFML: The ColdFusion Markup Language
ColdFusion Is Popular and Cost-Effective
Investing in a Web programming language is careful work because creating large-scale applications can be very expensive. Presumably, you're going to have to live with the environment that you select for a long time. For these reasons, you want to make sure that your language will continue to grow in the years to come and that it is capable of performing the heavy-hitting transactions that you'll require of it. ColdFusion is trusted on some of the most transaction-intensive, sensitive sites on the Web. For example, Bank of America, the United States Senate, and the Recording Industry of America all use ColdFusion to get their work done.
Perhaps the reason it's so popular is that, using ColdFusion, you can do a lot more than write dynamic Web pages and shopping carts. You can do really fantastic things with standard language elements that would require dozens of lines of code or custom tags in other languages. You can send and retrieve email over the Web and exchange data with COM, CORBA, and Java objects. You can use a subset of XML called Web Distributed Data eXchange (WDDX) to serialize and expose packets of data as generic XML. You can also perform file and directory manipulation, perform full FTP interactions, and create intelligent agents. It is easy to interact with LDAP servers with just one ColdFusion tag. You can create database-driven graphs and charts in Flash. And now ColdFusion 5 performs four times faster than its predecessor.
As in JSP, you can create your own extensions to the languagecustom tags. You can write custom tags in ColdFusion, C++, or Java. The ColdFusion Developer's Exchange and other Web sites have thousands of free custom tags available for download. These tags range from very simple utility tags to full-blown applications.
You probably know that, unlike JSP or PHP, ColdFusion is not free. You have to buy the application server from Macromedia, and it costs just over $1,000. While this is potentially cause for alarm in some development managers' eyes, I fail to see why. ColdFusion is intended as a rapid application-development platform. This means that the tags that make up the language encapsulate much of the complexity of the code required to perform sophisticated operations. One tag in ColdFusion can do the work of 10 or 20 lines of Java servlet code.
For instance, consider querying a database to retrieve information from it. You must first make a connection to the database, send it a SQL statement saying what information you're interested in and what you want to do with that information, and then get it back in a workable form. Here's how you might connect to an Oracle database to retrieve a record in Java Server Pages:
<%@ page import="java.sql.*" %> <% Connection conn; PreparedStatement stmt; %> <%! public void jspInit() { try{ String url = "jdbc:oracle:thin:@http://www.corecoldfusion.com:8080:book"; String user = "eben"; String password = "wxyz"; String sql = "SELECT firstname, lastname " + "FROM users" + "WHERE firstname = 'eben'"; Class.forName("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection(url, username, password); stmt = conn.prepareStatement(sql);} catch(SQLException e){} catch(ClassNotFoundException e){} }; %> <% public void jspDestroy() {try stmt.close(); conn.close(); }catch(SQLException e){} } %>
And that's the short version.
Or, we could just do the same thing in ColdFusion, like this:
<cfquery name="getName" datasource="MyDB"> SELECT firstname, lastname FROM Users WHERE firstname = 'Eben' </cfquery>
Both do the same thing (retrieve a record from a database). But which one is easier to write and faster to debug? Moreover, because you can extend the power of the tags that come with the language, you're not giving up any control! The more time you save in creating applications, the faster you can get the job done. Some development shops have estimated that they recoup the cost of buying the software in about a month. You can download and try out a free version for 30 days at http://www.macromedia.com/.