Conferring w/ Justin and "Stolen" from Mike Dinowitz's HOF style guide:
Code - There are a number of code issues that should be examined. Most of
them have to be written up in separate articles due to the depth of
information. Until these articles are out, here's the basics.
Every app should have a CFAPPLICATION tag - Even if you're not using state
management, you should have a CFAPPLICATION tag going. Most applications
have default values and storing them in application variables allows them to
be set for the entire app.
Run application defaults ONCE - Most people place CFSETs for application
defaults inside their application.cfm files. They expect that the variables
will be set once, but in reality they are set on EACH template. A better
idea is to use the following code:
<CFIF NOT IsDefined('Application.DSN')>
<CFSET Application.DSN = "datasource">
<CFSET Application.Root = "/htdocs/testbed/">
</CFIF>
This will cause the CFSETs to be used ONCE and only ONCE
END QUOTE.
I like Justin's addition to this as well "<cfset Application.IsInitialized=
"Yes">". Now.... whether <cfif IsDefined()> vs. <cfif NOT IsDefined()> is
better, well.... test er out :-)
Steve
----- Original Message -----
From: "Justin v0.9 MacCarthy" <[EMAIL PROTECTED]>
> > names, etc., when setting them in the Application.cfm file? Is it
<cfset>
> > or <cfparam>? Judging by the responses, I would assume that <cfset>
>
>
> The best way is to something like
>
> <cfif IsDefined("Application.IsInitialized")>
> <cfset Application.Myvar1 = "">
> <cfset Application.Myvar1 = "">
> <cfset Application.Myvar1 = "">
> <cfset Application.Myvar1 = "">
> .
> .
> .
> <cfset Application.IsInitialized= "Yes">
> </cfif>
>
>
> ~Justin MacCarthy
>
>
>
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.