This article will examine coding best practices for writing maintainable code, including consistent variable naming conventions, code structure, and comments.
This document was created for the purpose of explaining a personal programming technique using ColdFusion. The document explains an example Web site in terms of logic, ColdFusion architecture, and file structure. This document is technical in nature and a strong understanding of ColdFusion is required.
Content on the web often has a shelf life. You may have information that you want up after a certain point in time or you may want it to be gone after a certain time.You may want to have it appear and disappear without having to be editing files or changing out input in some back end system. You will find that you can build a simple system for publishing and removing info with ColdFusion's CFIF tag and CreateDateTime() and Now() functions.
Here is a coldfusion page I have created to keep track of my mileage. You can also download the page and an access database. You will have to change the datasourcename (line 1) to your data source name and you will have to change the purchase date on line 88 from 01/01/2000 to your purchase date.
Adding the power of Java servlets to your Web site is easier than ever when you combine the strengths of ColdFusion and JRun. However, every journey begins with one small step. To get started on the journey to the wonderful world of Java, Web developers using ColdFusion should become familiar with the two most common methods of invoking servlets: via the URL or using the tag
A key advantage in using ColdFusion to develop Web applications is the ease of which it allows you to integrate with other standard Internet protocol-based systems. The Lightweight Directory Access Protocol (LDAP) is a key Internet protocol supported by ColdFusion via the CFLDAP tag. The Microsoft Active Directory - which is the heart of Windows 2000 and XP network operating systems - provides an LDAP compliant interface. This LDAP interface allows the ability to integrate ColdFusion applications with the Microsoft Active Directory.
ColdFusion custom tags are ColdFusion templates just like any other CFML file but are designed to be reused. Coders can save much time by packaging code that is used frequently or can easily add functionality by using free or inexpensive custom tags. There are two general categories of custom tags, one uses only ColdFusion's CFML code. The other packages C++, Java, or other languages into a custom tag that is used by ColdFusion. We'll cover only CFML based tags in this article.
ColdFusion makes it easy to select data out of a database and display it on a page. As soon as you feel good about your success in crossing the divide from static to dynamic, someone will say "That's nice, can you group the list by author?". Whether you are asked to group things by author, make, brand, year or whatever, ColdFusion has you covered with its grouping capabilities.
A ColdFusion variable is created by assigning a value to it. Most commonly, you create variables by using the CFSet tag. You can also use the CFParam tag and assignment statements in CFScript. Tags that create data objects also create variables
Structures are everywhere in the ColdFusion world. As of ColdFusion 4.5, form, application, session, server, request, and URL variables are stored in structures. Allaire Spectra makes extensive use of structures and associative arrays.
We all know that locking is important. Most of us even understand why locks are needed. But exactly where to use a lock, which lock type to use and what code to put within the lock remains confusing at best.
We all start out learning ColdFusion by outputing variables using CFOUTPUT and some pound signs. A variable with an name like myvariable was passed to the page by a form or a link and output as #myvariable#. By not understanding and using scope, we unwittingly add inefficiencies to our code and overlook a lot of advantages that come with using scopes.
For anyone new to application development, you may be perplexed when you create your form for editing some data that should allow a user to uncheck a checkbox and update a record to a status of not checked. You will sooner or later discover an oddity about HTML forms. HTML forms won't allow you to uncheck like you think you should be able to. If you uncheck the checkbox, the value becomes NULL and the form doesn't bother to pass the field. You will find that ColdFusion does have a simple solution and much more with the CFPARAM tag
Macromedia's Chief Evangelist for ColdFusion, Ben Forta, spent the spring and early summer 2004 previewing the next generation of ColdFusion to user groups throughout North America. The pre-release name of the product is Blackstone and has a host of features that will be of interest to new and veteran ColdFusion and Flash programmers. Some of the major enhancements are: Wizards and enhancements for new CF'ers, major enhancement to CFFORM (key phrase: type = "flash"), introduction of CFDOCUMENT, and improved reporting with CFREPORT and a report creation tool
There are many things to consider when determining how you will host your ColdFusion site. Issues include tag availability, database needs, disk space, bandwidth, security, support, e-commerce, and software costs..
Among the many features provided by Macromedia's Web server clustering solution, ClusterCATS provides a feature called session-awareness. Session-awareness ensures that when a session begins on a particular clustered Web server, it will remain on that server until it is complete.