ࡱ > U@ L bjbj " D : D D D 8 D d `E E E 4 ,F ,F ,F ,F ,F ,F $ R H ,F ,F H H ,F ,F V V V H $
,F ,F V H V X V qV 3 K V ,F E p D AR ~ L ^ $ Ӫ 0 ʣ U V V R ,F L xF 6 V F , F C ,F ,F ,F d$ ) U . ) Coldfusion Web Development Standards
Table of Contents
Documentation 2
File Naming Standards 2
Directory Naming Standards 2
Images 2
StyleSheets 2
Query Naming 3
Quotes in Queries 3
Cached Queries 3
General HTML Guidelines 4
Comments 4
Application.cfm 4
Abbreviations 5
Dont use iif() 5
Custom Tags 5
Table Indentation 5
Tag Layout 6
Attribute Values 6
JavaScript and CSS ... 7
Session Timeouts 7
Session variables 8
Using pound signs (#) 8
Scope Names 8
Locking Shared Scope Variables 8
Oracle vs SQL Server Queries 10
Coldfusion Web Development Standards
Documentation
The beginning of all files should have documentation (within comment tags ) with the following information:
Description (brief desc. of template purpose)
Created By (Developer name)
Date Created (mm/dd/yyyy)
Input parameters (list)
Output parameters (list)
Modified By (Developer name) create a new line for each modification
Date Modified (mm/dd/yyyy) create a new line for each modification
File Naming Standards
- Filenames should accurately represent the content of the page. Refrain from using multiple word filenames, except for clarity. Use the following naming conventions for all templates (html, css and cfm):
filenameFiles used to display output to the user, usually as HTML
act_filenameFiles used to perform processing, such as credit card transactions or validating form input
qry_filenameFiles that interact with a database, usually as SQL queries or stored procedures
url_filenameFiles that perform an HTTP redirect, usually with CFLOCATION
Do not use special characters in filenames; e.g., &, $, *, %, etc. (example: it&classes.htm).
Do not use spaces between words (example: use itechclasses.htm, not itech classes.htm). Even though most web servers handle underscores ( _ ) you should refrain from using them because they are difficult to read in a URL address.
Make sure to use uppercase A for the Application.cfm (requirement for Unix). Use lowercase letters for all other filenames.
Default file in each directory should be index (.html, .htm, or .cfm)
Directory Naming Standards
The same conventions mentioned above for filenames also applies to directories (except for naming conventions.) Create only as many subdirectories as needed to help you manage your web site or that also make sense to the user. Too many subdirectories make for a lengthy URL address. All images should be within an images subdirectory. All administrator pages should be in admin subdirectory.
Images
Images should be used sparingly in order to minimize performance issues. Use HTML to write text rather than making an image with writing. Make sure to optimize images in order to reduce their size and loading time.
StyleSheets
Cascading Style Sheets should be used in order to control all formatting, font, colors, etc. The .css template should be located within the root directory of a project/application.
Query NamingQuery names follow the same convention as other variable names, utilizing the verbs Update, Insert, Delete, or Select in the case of select:
Query TypePatternExampleSelect DataquerynameSelectcustomerSelectUpdate DataquerynameUpdatecustomerUpdateInsert Data querynameInsertcustomerInsertDelete Data querynameDeletecustomerDelete
Quotes in Queries
Use double quotes when passing strings/parameters within a query:
with
and| tags are indented. The contents of | tags may be placed on a separate line, or if they are short they may be placed on the same line as the | .
Example:
|