RE: cfparam vs. cfif/isDefined/cfset
In your particular case, then yes, this makes sense. And for variables in application scope, this is probably good practice. I just wanted to point out that what is right for one situation is not always right for all situations. But that's kinda like stating the obvious to developers isn't it?... Shawn Grover -Original Message- From: Chris Norloff [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 11:58 AM To: CF-Talk Subject: RE: cfparam vs. cfif/isDefined/cfset For example: we maintain 5 server locations, some secure and some not. Some of the site-specific information is contained in application scoped variables. We either set them all or we don't set any. Thus, we check for one of them, and if it doesn't exist then set all of them. __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfparam vs. cfif/isDefined/cfset
Application.cfm runs with every request. If you set a variable in Application.cfm then the variable is set with every request. Chris Norloff -- Original Message -- from: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] date: Tue, 26 Mar 2002 13:48:27 -0500 >if you declare the variable inside the application.cfm, then you don't have >to set them with every request. > >Anthony Petruzzi >Webmaster >954-321-4703 >http://www.sheriff.org > > >-Original Message- >From: Chris Norloff [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, March 26, 2002 1:46 PM >To: CF-Talk >Subject: RE: cfparam vs. cfif/isDefined/cfset > > >So you don't have to set the variable again and again, with every request. > >Chris Norloff > >-- Original Message -- >from: [EMAIL PROTECTED] >Reply-To: [EMAIL PROTECTED] >date: Tue, 26 Mar 2002 13:18:40 -0500 > >>why use the application scope, when you have the request scope and you >don't >>have to mess with locking. >> >>Anthony Petruzzi >>Webmaster >>954-321-4703 >>http://www.sheriff.org >> >> >>-----Original Message----- >>From: Chris Norloff [mailto:[EMAIL PROTECTED]] >>Sent: Tuesday, March 26, 2002 1:11 PM >>To: CF-Talk >>Subject: Re: cfparam vs. cfif/isDefined/cfset >> >> >>Yes, they MUST be locked. >> >>These look like variables that don't change - I'd do a CFIF test on one, >and >>if it doesn't exist then set them all. As long as you always set them all >>together, you can use the existence of one to test for all. >> >>This way the app vars are set only once, and don't bog down your pages, >>since Application.cfm is called with every request. >> >>Chris Norloff >> >>-- Original Message -- >>from: "Earl, George" <[EMAIL PROTECTED]> >>Reply-To: [EMAIL PROTECTED] >>date: Tue, 26 Mar 2002 11:21:07 -0500 >> >>>Here is my application.cfm file: >>> >>>>>0)#> >>> >>> >>> >>> >>> >>> >>> >>> >>>Should I be locking these cfparam tags? Should I wrap them all in one lock >>>or should I lock each one individually? >>> >>>What is the difference between using cfparam tags as I have above and >using >>>cfif with isDefined and cfset to accomplish the same thing? Is one method >a >>>better practice than the other? >>> >>>Thanks! >>> >>>George >>>[EMAIL PROTECTED] >>> >> >> > > __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfparam vs. cfif/isDefined/cfset
cfparam checks only one variable at a time. The point is to check one variable of a bunch that are always set together, and se them all if it doesn't exist. For example: we maintain 5 server locations, some secure and some not. Some of the site-specific information is contained in application scoped variables. We either set them all or we don't set any. Thus, we check for one of them, and if it doesn't exist then set all of them. This is much faster than running cfparam on every single variable. Chris Norloff -- Original Message -- from: "Shawn Grover" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] date: Tue, 26 Mar 2002 11:47:27 -0700 >I agree, if you are using the application scope, they must be locked. >However, I fail to see a need to scope the variables (meaning local scope). >If Application.cfm gets run on every page (except includes, cfmodules/custom >tags), then these variables are ALWAYS available to you. > >As for the CFIF to determine if they exist, that's the purpose of CFPARAM >with a default attribute. If the parameter exists, it is used as is, >otherwise it is created with the default value. I've heard some talk over >time as to performance issues and such regarding CFPARAM and IsDefined(), >but have never seen a definitive answer saying one is most definetly >faster - and my own testing says they are both fast enough (for my purposes >at least). > >Some people will recommend putting all your variables in the Request scope >(thereby allowing custom tags to have access to them). I look at this as >declaring all your variables as global - which is frowned on in other >programming languages (C/C++, VB, Fortran, etc.) because it means more >care/management is required to make sure they are not being inadvertently >changed in some obscure function. It is better programming practice to use >the smallest scope (local scope) where possible, and pass parameters to >functions (or custom tags in this case). Those who would dispute this >either know something I don't, or don't have much experience outside web >development (no offense intended...). > >As for my own practices regarding variables similar to what you've shown, I >declare a LOCAL scoped structure called App. >Then make each variable a member of the structure. For example: > > > App = StructNew(); > //Datasources > StructInsert(App, "DSN", "MyDSN"); > > //Locations > StructInsert(App, "BaseURL", "http://localhost/myapp";); > StructInsert(App, "BaseDirectory", "/myapp"); > structInsert(App, "IncludesDir", "#App.BaseDirectory#/includes"; > > .. > > >With a little more thought, it's possible to declare the structure in the >application or session scope, and only create it once. Just be sure to lock >where needed. And keep in mind that only YOU know the right answer for your >needs. > >My two cents worth. > >Shawn Grover > >-Original Message- >From: Chris Norloff [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, March 26, 2002 1:11 PM >To: CF-Talk >Subject: Re: cfparam vs. cfif/isDefined/cfset > > >Yes, they MUST be locked. > >These look like variables that don't change - I'd do a CFIF test on one, and >if it doesn't exist then set them all. As long as you always set them all >together, you can use the existence of one to test for all. > >This way the app vars are set only once, and don't bog down your pages, >since Application.cfm is called with every request. > >Chris Norloff > >-- Original Message -- >from: "Earl, George" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >date: Tue, 26 Mar 2002 11:21:07 -0500 > >>Here is my application.cfm file: >> >>>0)#> >> >> >> >> >> >> >> >> >>Should I be locking these cfparam tags? Should I wrap them all in one lock >>or should I lock each one individually? >> >>What is the difference between using cfparam tags as I have above and using >>cfif with isDefined and cfset to accomplish the same thing? Is one method a >>better practice than the other? >> >>Thanks! >> >>George >>[EMAIL PROTECTED] >> > > > __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfparam vs. cfif/isDefined/cfset
if you declare the variable inside the application.cfm, then you don't have to set them with every request. Anthony Petruzzi Webmaster 954-321-4703 http://www.sheriff.org -Original Message- From: Chris Norloff [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 1:46 PM To: CF-Talk Subject: RE: cfparam vs. cfif/isDefined/cfset So you don't have to set the variable again and again, with every request. Chris Norloff -- Original Message -- from: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] date: Tue, 26 Mar 2002 13:18:40 -0500 >why use the application scope, when you have the request scope and you don't >have to mess with locking. > >Anthony Petruzzi >Webmaster >954-321-4703 >http://www.sheriff.org > > >-Original Message- >From: Chris Norloff [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, March 26, 2002 1:11 PM >To: CF-Talk >Subject: Re: cfparam vs. cfif/isDefined/cfset > > >Yes, they MUST be locked. > >These look like variables that don't change - I'd do a CFIF test on one, and >if it doesn't exist then set them all. As long as you always set them all >together, you can use the existence of one to test for all. > >This way the app vars are set only once, and don't bog down your pages, >since Application.cfm is called with every request. > >Chris Norloff > >-- Original Message -- >from: "Earl, George" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >date: Tue, 26 Mar 2002 11:21:07 -0500 > >>Here is my application.cfm file: >> >>>0)#> >> >> >> >> >> >> >> >> >>Should I be locking these cfparam tags? Should I wrap them all in one lock >>or should I lock each one individually? >> >>What is the difference between using cfparam tags as I have above and using >>cfif with isDefined and cfset to accomplish the same thing? Is one method a >>better practice than the other? >> >>Thanks! >> >>George >>[EMAIL PROTECTED] >> > > __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfparam vs. cfif/isDefined/cfset
So you don't have to set the variable again and again, with every request. Chris Norloff -- Original Message -- from: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] date: Tue, 26 Mar 2002 13:18:40 -0500 >why use the application scope, when you have the request scope and you don't >have to mess with locking. > >Anthony Petruzzi >Webmaster >954-321-4703 >http://www.sheriff.org > > >-Original Message- >From: Chris Norloff [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, March 26, 2002 1:11 PM >To: CF-Talk >Subject: Re: cfparam vs. cfif/isDefined/cfset > > >Yes, they MUST be locked. > >These look like variables that don't change - I'd do a CFIF test on one, and >if it doesn't exist then set them all. As long as you always set them all >together, you can use the existence of one to test for all. > >This way the app vars are set only once, and don't bog down your pages, >since Application.cfm is called with every request. > >Chris Norloff > >-- Original Message -- >from: "Earl, George" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >date: Tue, 26 Mar 2002 11:21:07 -0500 > >>Here is my application.cfm file: >> >>>0)#> >> >> >> >> >> >> >> >> >>Should I be locking these cfparam tags? Should I wrap them all in one lock >>or should I lock each one individually? >> >>What is the difference between using cfparam tags as I have above and using >>cfif with isDefined and cfset to accomplish the same thing? Is one method a >>better practice than the other? >> >>Thanks! >> >>George >>[EMAIL PROTECTED] >> > > __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfparam vs. cfif/isDefined/cfset
I agree, if you are using the application scope, they must be locked. However, I fail to see a need to scope the variables (meaning local scope). If Application.cfm gets run on every page (except includes, cfmodules/custom tags), then these variables are ALWAYS available to you. As for the CFIF to determine if they exist, that's the purpose of CFPARAM with a default attribute. If the parameter exists, it is used as is, otherwise it is created with the default value. I've heard some talk over time as to performance issues and such regarding CFPARAM and IsDefined(), but have never seen a definitive answer saying one is most definetly faster - and my own testing says they are both fast enough (for my purposes at least). Some people will recommend putting all your variables in the Request scope (thereby allowing custom tags to have access to them). I look at this as declaring all your variables as global - which is frowned on in other programming languages (C/C++, VB, Fortran, etc.) because it means more care/management is required to make sure they are not being inadvertently changed in some obscure function. It is better programming practice to use the smallest scope (local scope) where possible, and pass parameters to functions (or custom tags in this case). Those who would dispute this either know something I don't, or don't have much experience outside web development (no offense intended...). As for my own practices regarding variables similar to what you've shown, I declare a LOCAL scoped structure called App. Then make each variable a member of the structure. For example: App = StructNew(); //Datasources StructInsert(App, "DSN", "MyDSN"); //Locations StructInsert(App, "BaseURL", "http://localhost/myapp";); StructInsert(App, "BaseDirectory", "/myapp"); structInsert(App, "IncludesDir", "#App.BaseDirectory#/includes"; .. With a little more thought, it's possible to declare the structure in the application or session scope, and only create it once. Just be sure to lock where needed. And keep in mind that only YOU know the right answer for your needs. My two cents worth. Shawn Grover -Original Message----- From: Chris Norloff [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 1:11 PM To: CF-Talk Subject: Re: cfparam vs. cfif/isDefined/cfset Yes, they MUST be locked. These look like variables that don't change - I'd do a CFIF test on one, and if it doesn't exist then set them all. As long as you always set them all together, you can use the existence of one to test for all. This way the app vars are set only once, and don't bog down your pages, since Application.cfm is called with every request. Chris Norloff -- Original Message -- from: "Earl, George" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] date: Tue, 26 Mar 2002 11:21:07 -0500 >Here is my application.cfm file: > >0)#> > > > > > > > > >Should I be locking these cfparam tags? Should I wrap them all in one lock >or should I lock each one individually? > >What is the difference between using cfparam tags as I have above and using >cfif with isDefined and cfset to accomplish the same thing? Is one method a >better practice than the other? > >Thanks! > >George >[EMAIL PROTECTED] > __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfparam vs. cfif/isDefined/cfset
why use the application scope, when you have the request scope and you don't have to mess with locking. Anthony Petruzzi Webmaster 954-321-4703 http://www.sheriff.org -Original Message- From: Chris Norloff [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 1:11 PM To: CF-Talk Subject: Re: cfparam vs. cfif/isDefined/cfset Yes, they MUST be locked. These look like variables that don't change - I'd do a CFIF test on one, and if it doesn't exist then set them all. As long as you always set them all together, you can use the existence of one to test for all. This way the app vars are set only once, and don't bog down your pages, since Application.cfm is called with every request. Chris Norloff -- Original Message -- from: "Earl, George" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] date: Tue, 26 Mar 2002 11:21:07 -0500 >Here is my application.cfm file: > >0)#> > > > > > > > > >Should I be locking these cfparam tags? Should I wrap them all in one lock >or should I lock each one individually? > >What is the difference between using cfparam tags as I have above and using >cfif with isDefined and cfset to accomplish the same thing? Is one method a >better practice than the other? > >Thanks! > >George >[EMAIL PROTECTED] > __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfparam vs. cfif/isDefined/cfset
Yeah, the request rounte it the way to go. I also have a "Settings" table in my apps for application/request vars used in a particular application. Take a look at this snip from my application.cfm request.dsSQL = "whatever"; request.RootURL = "http://whatever.com";; request.RootPath = "x:\whatever\whatever.com"; request.zeroGUID = "----"; SELECT SettingName, SettingValue FROM Settings structDelete(application, "setting"); application.setting = StructNew(); for (i=1; i lte qrySettings.recordCount; i=i+1) { "application.setting.#qrySettings.SettingName[i]#" = qrySettings.SettingValue[i]; } request.setting = StructNew(); request.setting = Duplicate(application.setting); Justin Hansen -- Uhlig Communications Web Developer / Programmer -- [EMAIL PROTECTED] 913-498-0123 ext 284 -- -Original Message- From: Sharon DiOrio [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 26, 2002 11:10 AM To: CF-Talk Subject: Re: cfparam vs. cfif/isDefined/cfset I tend to set all the commonly used defaults as Request scope variables. No locking, no , available anywhere. REQUEST.dsn = "myDSN"; REQUEST.dbType = "dbtype"; REQUEST.webRoot = "C:/inetpub/wwwroot/"; etc... PS, Good to know that UDFs are faster. Are there any exceptions to the rule? Sharon - Original Message - From: "Michael Dinowitz" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, March 26, 2002 11:35 AM Subject: Re: cfparam vs. cfif/isDefined/cfset > 1. You should lock the entire group with a CFLOCK and a scope of application. > 2. An IsDefined() with a set is actually slightly faster than a CFAPPLICATION. There's even a UDF that does just this and its still faster even with the small UDF overhead. Note that this is limited to the isdefined() then default. When you start doing the other things that a CFPARAM is useful for then the balance changes. > > At 11:21 AM 3/26/02, you wrote: > >Here is my application.cfm file: > > > > >0)#> > > > > > > > > > > > > > > > > > >Should I be locking these cfparam tags? Should I wrap them all in one lock > >or should I lock each one individually? > > > >What is the difference between using cfparam tags as I have above and using > >cfif with isDefined and cfset to accomplish the same thing? Is one method a > >better practice than the other? > > > >Thanks! > > > >George > >[EMAIL PROTECTED] > > > __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: cfparam vs. cfif/isDefined/cfset
Yes, they MUST be locked. These look like variables that don't change - I'd do a CFIF test on one, and if it doesn't exist then set them all. As long as you always set them all together, you can use the existence of one to test for all. This way the app vars are set only once, and don't bog down your pages, since Application.cfm is called with every request. Chris Norloff -- Original Message -- from: "Earl, George" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] date: Tue, 26 Mar 2002 11:21:07 -0500 >Here is my application.cfm file: > >0)#> > > > > > > > > >Should I be locking these cfparam tags? Should I wrap them all in one lock >or should I lock each one individually? > >What is the difference between using cfparam tags as I have above and using >cfif with isDefined and cfset to accomplish the same thing? Is one method a >better practice than the other? > >Thanks! > >George >[EMAIL PROTECTED] > __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: cfparam vs. cfif/isDefined/cfset
there is however a minute difference between cfparam and the if/else block... the if/else block outperforms the params. more code maybe, but when writing the the application I recommend doing it as quickly as possible and with exclusive locks. - Original Message - From: "Bryan Stevenson" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, March 26, 2002 4:33 PM Subject: Re: cfparam vs. cfif/isDefined/cfset > Definately wrap a lock around those, and I would only run that block if 1 of the vars inside isn't > defined (if 1 isn't then they all aren'tlike when CF Server is restarted). > > As far as CFPARAM goes > You are correct in using it herewhy write 3 lines of code when you can write 1 ;-) > > HTH > > Bryan Stevenson > VP & Director of E-Commerce Development > Electric Edge Systems Group Inc. > p. 250.920.8830 > e. [EMAIL PROTECTED] > - > Macromedia Associate Partner > www.macromedia.com > - > Vancouver Island ColdFusion Users Group > Founder & Director > www.cfug-vancouverisland.com > > - Original Message - > From: "Earl, George" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Tuesday, March 26, 2002 8:21 AM > Subject: cfparam vs. cfif/isDefined/cfset > > > > Here is my application.cfm file: > > > > > 0)#> > > > > > > > > > > > > > > > > > > Should I be locking these cfparam tags? Should I wrap them all in one lock > > or should I lock each one individually? > > > > What is the difference between using cfparam tags as I have above and using > > cfif with isDefined and cfset to accomplish the same thing? Is one method a > > better practice than the other? > > > > Thanks! > > > > George > > [EMAIL PROTECTED] > > > __ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: cfparam vs. cfif/isDefined/cfset
I tend to set all the commonly used defaults as Request scope variables. No locking, no , available anywhere. REQUEST.dsn = "myDSN"; REQUEST.dbType = "dbtype"; REQUEST.webRoot = "C:/inetpub/wwwroot/"; etc... PS, Good to know that UDFs are faster. Are there any exceptions to the rule? Sharon - Original Message - From: "Michael Dinowitz" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, March 26, 2002 11:35 AM Subject: Re: cfparam vs. cfif/isDefined/cfset > 1. You should lock the entire group with a CFLOCK and a scope of application. > 2. An IsDefined() with a set is actually slightly faster than a CFAPPLICATION. There's even a UDF that does just this and its still faster even with the small UDF overhead. Note that this is limited to the isdefined() then default. When you start doing the other things that a CFPARAM is useful for then the balance changes. > > At 11:21 AM 3/26/02, you wrote: > >Here is my application.cfm file: > > > > >0)#> > > > > > > > > > > > > > > > > > >Should I be locking these cfparam tags? Should I wrap them all in one lock > >or should I lock each one individually? > > > >What is the difference between using cfparam tags as I have above and using > >cfif with isDefined and cfset to accomplish the same thing? Is one method a > >better practice than the other? > > > >Thanks! > > > >George > >[EMAIL PROTECTED] > > > __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: cfparam vs. cfif/isDefined/cfset
1. You should lock the entire group with a CFLOCK and a scope of application. 2. An IsDefined() with a set is actually slightly faster than a CFAPPLICATION. There's even a UDF that does just this and its still faster even with the small UDF overhead. Note that this is limited to the isdefined() then default. When you start doing the other things that a CFPARAM is useful for then the balance changes. At 11:21 AM 3/26/02, you wrote: >Here is my application.cfm file: > >0)#> > > > > > > > > >Should I be locking these cfparam tags? Should I wrap them all in one lock >or should I lock each one individually? > >What is the difference between using cfparam tags as I have above and using >cfif with isDefined and cfset to accomplish the same thing? Is one method a >better practice than the other? > >Thanks! > >George >[EMAIL PROTECTED] > __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: cfparam vs. cfif/isDefined/cfset
Definately wrap a lock around those, and I would only run that block if 1 of the vars inside isn't defined (if 1 isn't then they all aren'tlike when CF Server is restarted). As far as CFPARAM goes You are correct in using it herewhy write 3 lines of code when you can write 1 ;-) HTH Bryan Stevenson VP & Director of E-Commerce Development Electric Edge Systems Group Inc. p. 250.920.8830 e. [EMAIL PROTECTED] - Macromedia Associate Partner www.macromedia.com - Vancouver Island ColdFusion Users Group Founder & Director www.cfug-vancouverisland.com - Original Message - From: "Earl, George" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Tuesday, March 26, 2002 8:21 AM Subject: cfparam vs. cfif/isDefined/cfset > Here is my application.cfm file: > > 0)#> > > > > > > > > > Should I be locking these cfparam tags? Should I wrap them all in one lock > or should I lock each one individually? > > What is the difference between using cfparam tags as I have above and using > cfif with isDefined and cfset to accomplish the same thing? Is one method a > better practice than the other? > > Thanks! > > George > [EMAIL PROTECTED] > __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: cfparam vs. cfif/isDefined/cfset
> Here is my application.cfm file: > > applicationtimeout=#CreateTimeSpan(2, 0, 0, > 0)#> > > > > > > > > > Should I be locking these cfparam tags? Yes. Make sure you set TYPE="EXCLUSIVE", since you may be setting the values. > Should I wrap them all in one lock or should I lock each > one individually? I'd wrap them all in one lock. > What is the difference between using cfparam tags as I have > above and using cfif with isDefined and cfset to accomplish > the same thing? There's no functional difference between the two. > Is one method a better practice than the other? That's a good question. I use CFPARAM for this, myself, but I suspect that it performs more slowly in certain situations. In any case, though, the difference will be insignificant, and one line of code is better than three, all other things being equal. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists