![]() |
Fusion Authority The House of Fusion Technical Magazine |
Issue:
4 January 3, 2000 January 9, 2000 |
| This is an opt-in magazine. To join, leave or change subscription mode, please visit the signup page. All content of this magazine is copyright Fusion Authority, Inc. It may not be reproduced without permission. | ||
Those servers will connect to Allaire's ColdFusion application server and will include a Java Server Pages (JSP) server with full support for the JSP 1.1 and Servlets 2.2 specifications, an EJB server compliant with the EJB 1.1 specification, a Java transaction server based on the Java Transaction Architecture 1.0 specification, and a Java message queue server based on the Java Messaging Service 1.0 specification.
Allaire also plans to continue selling Valto's Ejipt 1.2 EJB server. Look for a public beta release of the next-generation Ejipt later this month.
Allaire Announcement
[Top]
[Top]
[Top]
[Top]
This research report is available free; you will be asked to register at multex.com to download the document: http://www.multexinvestor.com/download.asp?docid=1358299&promo=bw
[Top]
For more information, see http://www3.allaire.com/developer/gallery/index.cfm?Objectid=13910.
[Top]
For more information, see http://www2.allaire.com/developer/gallery/index.cfm?Objectid=13929
[Top]
[Top]
[Top]
A tremendous thank you to the members of the CF-Talk list, who provided House of Fusion with some statistics on CF-Talk activity in 1999. Here are the results of their research:
As Cameron Childress noted, "That's an awful lot of email service to be providing for free."
On Friday, January 7, 2000, between the hours of 10:00AM and 5:00PM EST, 95 messages were posted to the list. With over 1200 subscribers, that generated 16,285 outgoing emails at the average rate of 271 messages sent per minute or 4.5 emails every second.
Assume an average email of about 2 or 3K in size. That would put last year's bandwidth consumption by CF-Talk at a little less than 139 Gigs. If everyone trimmed just one kilobyte off their replies to the list, that would bring that number down to about 92 Gigs. This could make quite a difference when sending out 4.5 emails per second.
Based on these numbers, every 2K email sent to the list creates about 2.3 megs of outgoing email, but every 3K message creates 3.5 megs of outgoing email. So does it matter if you trim your posts? Apparently, on CF-Talk, the answer is "Yes!"
These statistics serve to underscore the monumental task it can be to sustain CF-Talk (and the numerous related ColdFusion mailing lists on the roster here.) Many of our members, after seeing these figures, thanked Michael for his dedication in providing these resources to the community on his own free time. In turn, Michael and I would like to thank the community for being so responsive on the lists and in other forums. You help make the CF community the open, friendly place it is. Keep up the good work, and may we go into an even better year!
[Top]
CFSET is probably the first tag that anyone learns in ColdFusion. Unfortunately, few learn it efficiently. Eventually, they learn through trial-and-error or from reading docs on how to do it right, but that's usually a while into their career. This paper should change that and serve to pull together all the different documentation about CFSET into one location.
I'm going to lay out some 'laws' of the CFSET tag that I've found to be the most efficient. They'll include when and where to use pound signs (#), how to create dynamic variables and when setting a variable isn't even needed. Please remember that while I call these laws, they're really good suggestions. If you find some practice that works better, use it. If you find something wrong in what I'm writing, please contact me so we can set it right.
There are actually two functions of the CFSET tag. The first is Assignment and the second is Execution . When used for Assignment, the CFSET tag can be said to have two parts. (This is rather important as it will color the terminology I'll be using throughout the article and in almost all my writings.) The first part of a CFSET tag is the Variable. This is the name of a variable that will be set by the CFSET operation. This value is usually static, but can be dynamically created in a special circumstance. The Variable section of a CFSET tag is only used in Assignment; It is not needed in Execution. The second part of the CFSET tag is the Value. This is the information that will be placed into the Variable. This information can be static, dynamic or a combination of the two. We can even use functions as dynamic information. This part of a CFSET is always used. When a CFSET tag is used for Execution, it allows certain ColdFusion functions to be run without trying to assign any value to a variable. In this case, only the Variable portion of the CFSET is used.
A Variable may only contain letters (a-z), numbers (0-9) or an underscore (_). No other character may be used in a Variable. A period (.) is used only to separate a Variable name from its Scope. All Variables are case insensitive.
|
Wrong: <CFSET Name$ = "Michael">
Right: <CFSET FirstName = "Michael"> Right: <CFSET Variables.FirstName = "Michael"> |
A Variable may not start with a number (0-9) or an underscore (_). Only letters (a-z) may be used.
|
Wrong: <CFSET 1stName = "Michael">
Right: <CFSET FirstName = "Michael"> |
Remember to always close off your quotes in a tag.
|
Wrong: <CFSET FirstName = "Michael>
Right: <CFSET FirstName = "Michael"> |
Remember to always close your tags properly.
|
Wrong: <CFSET FirstName = "Michael"
Right:<CFSET FirstName = "Michael"> |
Variables should be as descriptive as possible. ColdFusion does not use more resources to write a long variable vs. a short one.
|
Wrong: <CFSET FNM = "Michael">
Right: <CFSET FirstName = "Michael"> |
All ColdFusion tag attributes should only be in double quotes ("). This is to differentiate them from function attributes which should only be in single quotes (').
|
Wrong: <CFSET FirstName = 'Michael'>
Right: <CFSET FirstName = "Michael"> |
The first character of a Variable should be capitalized. In addition, capitals should be used in various places to make the Variable more descriptive. Finally, a capital should be used after the period in a Scoped Variable .
|
Wrong: <CFSET firstname = "Michael">
Right: <CFSET FirstName = "Michael"> Right: <CFSET Variables.FirstName = "Michael"> |
When setting and/or using a string that contains both text and variables, you should separate the string component from the dynamic variable component and concatenate them together using an ampersand (&).
|
Wrong: <CFSET firstname = "Michael#url.id#">
Right: <CFSET FirstName = "Michael"&Url.ID> |
To expand on the last note, when the Value section of a CFSET only has a dynamic variable or a function, it should not be placed in pound signs (#) and quotes ("). This is commonly done.
|
Wrong: <CFSET firstname = "#Url.ID#">
Right: <CFSET FirstName = Url.ID> |
The Variable part of a CFSET does not need pound signs unless you're setting a dynamic variable name, in which case it should be inside double quotes (") as well.
|
Wrong: <CFSET #Name# = "Michael">
Right: <CFSET "#Name#" = "Michael"> |
When setting a dynamic Variable in a CFSET, remember to place the entire Variable within double quotes (").
|
Wrong: <CFSET #varname# = "value">
Wrong: <CFSET var#name# = "value"> Right: <CFSET "#varname#" = "value"> Right: <CFSET "var#name#" = "value"> |
The Variable part of a CFSET does not need quotes unless it is being dynamically set. This actually has a savings in time of approximately .004 ms.
|
Wrong: <CFSET "Name" = "Michael">
Right: <CFSET Name = "Michael"> |
When a large number (3+) of CFSETS are used in a row, it is more efficient to place them within a CFSCRIPT block. The savings is .02 ms and increases with each CFSET added. When 4 or 5 are used, the savings was .04 ms.
|
Option1:
<CFSET FirstName = 'Michael'> <CFSET Lastname = 'Dinowitz'> <CFSET Email = 'Mdinowitz@houseoffusion.com'> Option2: <CFSCRIPT> FirstName = 'Michael'; Lastname = 'Dinowitz'; Email = 'Mdinowitz@houseoffusion.com'; </CFSCRIPT> |
|
<CFSET Function()>
|
The following functions can be used in this way:
| ArrayAppend | ArrayClear | ArrayDeleteAt |
| ArrayInsertAt | ArrayPrepend | ArrayResize |
| ArraySet | ArraySwap | CF_SetDataSourceUsername |
| CF_SetDataSourcePassword | CFUSION_SETODBCINI | CFUSION_SETTINGS_REFRESH |
| CFusion_DBConnections_Flush | QueryAddRow | QuerySetCell |
| SetLocale | SetProfileString | SetVariable |
| StructClear | StructDelete | StructInsert |
| StructUpdate | WriteOutput |
This is usually used in such statements as the following one, which will delete a user session:
|
<CFSET StructClear(Session)>
|
Now before you get a smart idea about using a CFSET to output variables in place of a CFOUTPUT, let me tell you that it is less efficient.
|
<CFSET WriteOutput(Url.FirstName)>
|
To be continued ...
[Top]
Allaire has recently released patches for certain technical problems in ColdFusion 4.5. These problems have been reported by ColdFusion users to Allaire in the Forums.
Solutions released include:
Allaire has posted a workaround.
Solution: The NS library was modified so that it would recognize these boundaries and attachments would be handled correctly by CFPOP. As this modified the MIME libraries, apply the patch to any CFPop code that was working in CF Server 4.01, but no longer works in CF Server 4.5.
[Top]
Problem: An authentic Webtop user (who has been given permission to at least one section of the Webtop) can access other sections of the Webtop by typing explicit URLs.
For more information, see Allaire Security Bulletin (ASB00-01).
[Top]
For more information, see Allaire Security Bulletin (ASB00-02): Addressing Potential Denial Of Service Problem With Installation Files In Allaire Spectra 1.0.
[Top]
This bug concerns ColdFusion 4.0x users.
Problem: The CFCACHE tag, which performs template caching to increase page delivery performance, creates several temporary files, including one that contains absolute filenames with directory path information, URL parameters and timestamps. In ColdFusion 4.0x, these files are stored in the same directory as the .CFM page, usually in a publicly accessible web document directory, making information about the web document directory structure or URL parameters used to call site pages accessible.
Solution: Allaire has released a new version of the CFCACHE tag (also available in ColdFusion 4.5) that allows users to specify a non-web document directory to store the temporary file, making them inaccessible to browsers.
For more information, see Allaire Security Bulletin (ASB00-03)
[Top]
What's the Problem? The HomeSite 4.5 upgrade will not work if there is any instance of HomeSite 4.5 on your system. For example, If you previously had HomeSite 4.5 Evaluation or Beta version on your system.
Solutions to the problem available in the article at http://www.allaire.com/Handlers/index.cfm?ID=13935.
[Top]
For more information, see http://www.allaire.com/Handlers/index.cfm?ID=14020.
[Top]
| This is an opt-in magazine. To join, leave or change subscription mode, please visit the signup page. All content of this magazine is copyright Fusion Authority, Inc. It may not be reproduced without permission. | ||