Web applications are a standard feature of any modern business. On public facing Internet servers, on secure extranets, or in the heart of the corporate intranet, you’ll find web applications handling everything from Sometimes there is need to build dynamic web applications quickly. There may be no time to sit there debugging Java code or writing ASP or CGI scripts – especially when you’ve got to deliver that database driven web application yesterday. However the tool you use to build these applications will need to be as robust as the web application and e-commerce systems you normally use, and capable of running complex applications as well as simple database queries.
An answer to this problem is Cold Fusion’s tag driven web application development environment. One of the first web application suites, Cold Fusion has begun to move into the world of the application server with the recent release of Cold Fusion 4.0.
Cold Fusion started life as a set of CGI scripts. With the advent of web server APIs, the server component of Cold Fusion was rewritten as an NT service and a UNIX daemon, able to take requests directly from a web server. You can also use it with a CGI-only web server, thanks to a compiled CGI program that acts as an interface to the server – though this will obviously be slower than the equivalent APIs, and so isn’t really recommended for use on production servers.
You’ll find that Cold Fusion applications are built in the form of page templates, containing a mix of HTML (and DHTML!) and the Cold Fusion Mark-up Language (CFML). CFML is designed to be similar to HTML, and contains tags that will allow you to work directly with databases and HTML form inputs, as well as building conditional structures into your pages. All Cold Fusion templates have the file type .cfm, and this is used to redirect their contents through the Cold Fusion server for processing, rather than directly delivering their contents to a browser. Database interaction is via the familiar ODBC.
There are two components to Cold Fusion: the Application Server and the Cold Fusion Studio IDE. The Application Server runs on Intel systems using Windows 95, 98 and NT, as well as Sun SPARCs running Solaris and HP HP/UX systems. There’s no difference between the three servers – so code you develop on a Windows 95 desktop PC system will run on a SPARC, without needing a rewrite. You’ll find that Cold Fusion has support for four of the most popular web servers: Apache, Microsoft’s IIS, Netscape Enterprise Server, and O’Reilly’s Website Pro.
You can control Cold Fusion Application Server via a web-based administration tool. A tab style interface allows you to configure the server. The most important is the “Server” tab. This allows you to fine tune the performance of your server. You can use it to limit the number of simultaneous requests, helping control the load on your server – don’t forget that the default is an unlimited number of simultaneous requests! You can also time out requests, so that complex queries won’t tie up the server.
One important feature is the ability of the Application Server to cache CFML templates. This speeds up your applications, as disk accesses are reduced. It’s a good idea to set the size of your cache to the total size of all the pages in your application; otherwise you can see performance degradation when many different pages are being delivered. Other options allow you to tune Cold Fusion’s session performance. One to keep an eye on is the client purge settings. As persistent information is stored on the server it is important to make sure that out of date information isn’t cached for long periods – using up valuable system resources.
Cold Fusion uses ODBC to connect to external databases. Another section of the web interface allows you to configure ODBC data sources, as well as verify the settings. It’s also possible to use this tool to create new ODBC data sources – and as it’s a web interface, connections can be configured remotely.
Debugging web applications is often a problem, and Cold Fusion gives you the tools you need to debug your applications, by adding information to your Cold Fusion pages. This information includes all variables in use, as well as any dynamically created SQL queries. You can also see how long it takes for a page to process. Of course, you don’t want all your users to see that you’re debugging an application (especially if your just using these tools to monitor the performance of a live system), and you can limit the delivery of this information to specific IP addresses.
You’ll also need to configure your server to deliver mail to an SMTP server, so that automatically generated email messages are sent to your users. Mail is also used to deliver warnings to the administrator, and this can be configured along with logging information, using a separate section of the Cold Fusion administration tools. The rest of the tabs on the administration web interface allow you to limit the tags used on a site, as well as to handle mapped directories and scheduled events. You can also use the web interface to configure Cold Fusion’s built-in Verity search engine, as well as any Java applets that can be added to Cold Fusion forms.
