At 04:31 PM 6/25/2002 -0400, you wrote:
>Dear friends,
>
>Sorry for this stupid question but I really didn't find a consensus on
>that. What is the best variable scope to be used on applications (not
>using Fusebox or any other methodology) that need to be present on every
>template.

  There is no solid answer.  I really suggest that you learn about all the 
variable scopes and then you can pick and choose the one that best suits 
your needs.

>Variables that we can use in the Application.cfm to set a
>datasource name, page titles, etc. Application scope is not consider
>because it requires the use of CFLOCK and I don't want to remember it
>(and lock my code) everytime I need to output a datasource name, for
>example.

  The application scope has its place, and I don't think that "to avoid 
locking" is a good reason to not use it.
  However, many people use the application scope for things that I don't 
consider good ideas (such as a datasource varaible).


>I use the simple Local variables (by seting it using <CFSET var="value">
>or <CFSCRIPT> when there are many of than) but I have seen people using
>Request.variable instead. Wich is best in terms of speedy and safety?

  Local variables (I.E. the variables scope) are great for many 
purposes.  I definitely use them the most.
  I rarely (if ever) use the request scope.  I may be the only one, though.
  In my experience, people use the request scope is to avoid sending 
parameters to custom tags.  This lowers the re-use of the custom tag and 
goes against my own person theories on code modularization, so I do not 
recommend doing this.

  If you are not using custom tags, then there will be little 
difference  between using the request and variables scopes.

  (Note: I'm not sure off the top of my head how CFCs and/or UDFs reference 
the request scope in relation to the calling template).



--
Jeffry Houser | mailto:[EMAIL PROTECTED]
Need a Web Developer?  Contact me!
AIM: Reboog711  | Fax / Phone: 1-203-379-0773
--
My CFMX Book: 
<http://www.amazon.com/exec/obidos/ASIN/0072225564/instantcoldfu-20>
My Books: http://www.instantcoldfusion.com
My Band: http://www.farcryfly.com 

______________________________________________________________________
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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to