> > First, what's wrong with setting local variables in Application.cfm?
> 
> I don't like the (potential) scoping implications of it... 
> local variables set in the application.cfm, particularly for 
> some of the most common variables that are set this way 
> (dsn/datasource for instance) are then not available to 
> custom tags. Sure you can add <cfset request.dsn = 
> variables.dsn> on the line below, but then you're doubling up 
> the code needed to set it, and in the individual pages you've 
> got some references to request.dsn and lots of references to 
> #dsn# (with no scope). It boils down more to a matter of bad 
> scoping habbits than one really of setting variables in the 
> application.cfm, but personally I consider it poor practice 
> to set local variables there -- much better to use 
> Application.cfm only to set request, cookie and 
> persistent-scope variables.

It is a mistake to extrapolate from the fact that you don't like something,
that it is a bad practice.

There's nothing wrong with setting local variables within Application.cfm.
If you do so, they won't be available to custom tags; you are certainly
right about that. But in most cases, there's no need to make them available
to custom tags, if those custom tags are written so as to be as loosely
coupled to the application as possible. If you explicitly want to use the
Request scope, you can use that instead, but that doesn't make the use of
the local Variables scope within Application.cfm a bad practice.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:208499
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to