![]() ![]() ![]() |
When you build a ColdFusion application, you create application pages to capture data and provide output. Application pages can contain ColdFusion Markup Language (CFML) tags, HTML tags, Custom CFML tags, CFScript, JavaScript code, and anything else that an HTML page can contain.
When browser clients such as Netscape Communicator, or Microsoft Internet Explorer, request an ordinary HTML page, the browser interprets the HTML page and renders the output in the browser window. When a browser requests a ColdFusion application page, ColdFusion first processes it and then outputs HTML to the web browser. No client software, components, or plug-ins are needed to open ColdFusion application pages. All the processing occurs on the server.
To retrieve data in a ColdFusion application, you can build ColdFusion pages to capture the data a user enters in a form. Most ColdFusion applications interact with an ODBC data source, but other data sources are also available. You can retrieve data from a variety of sources, such as directory servers (LDAP), mail servers (POP), data indexed in Verity collections, or FTP servers.
A ColdFusion application can consist of dozens of application pages, depending on its complexity. Pages typically perform specific functions, such as providing a user-entry interface, presenting output, or retrieving data.
For Web applications, efficiency is crucial. You'll want to find the best way to balance the need for server-intensive operations like large database queries against the need to display information for your users as quickly as possible. If you are designing an application to run in a corporate intranet, you may not have the bandwidth constraints imposed by designing an application to run over the public Web.
Additional design considerations include planning for code reuse (which includes commenting your code and using clear, descriptive names for variables and data sources) and following other programming and database design conventions.
ColdFusion developers can use the authentication and authorization features to control access to applications based on runtime user security. After setting up the security framework in the ColdFusion Administrator, you can authenticate users against NT domains or LDAP directories.
ColdFusion's ability to cache pages as well as database queries can dramatically affect the performance of your Web applications. In addition, with ColdFusion's page scheduling feature, you can schedule large database operations for off-hours to produce static HTML pages of data for your application.
Application pages can consist of CFML or HTML or both, according to the role they play in your application. You may choose to build forms in straight HTML for users to enter data, or use one of the many Java applet-based ColdFusion form controls (such as a tree control, data grid, or slider) without having to know anything about Java.
It's easy to use forms to collect data from users. And it's just as easy to pass form data to a ColdFusion application page for processing. When a form is submitted, form variables are passed to the application page specified in the form ACTION attribute. Form variables can be referenced to display data, perform queries, or serve in a variety of other operations.
The application page can use the form data to execute some process, whether it's running a query against an ODBC data source or retrieving mail. In a shopping cart application, for example, you could give users a simple way to add items to a virtual shopping basket using a form.
In addition to pages that perform a data collecting role, you'll probably design pages that simply process data passed to them from a query, form input, or by some other means.
Often, ColdFusion application pages perform some degree of processing in addition to whatever information they might display to the user. For example, you might have a page that displays a table of data retrieved from a database. The ColdFusion code that performs the retrieval can be written in the page header, so that when the page is requested by a browser, ColdFusion runs a query against the specified data source and produces a page dynamically based on user selections or other variables you can create and use.
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.