***************************** Team Allaire *****************************
Why kill all the cool speed increase you get from a UDF by putting it in a
custom tag? A 'header library' is acceptable in most languages so putting
<CFINCLUDE template="/cfide/library/libdebug.cfm">
in the application.cfm is good. Putting
<CFINCLUDE template="/cfide/library/libfile.cfm">
on the top of your template is also acceptable and probably more so than the
custom tag. Just have all the file manipulation UDFs in the include.
CFINCLUDE has a whole lot less overhead than custom tags. Once a UDF is
defined once, it can be used over and over again on the same page. The
reason I suggested putting it in server vars is that you can do this:
<CFIF Not IsDefined('server.udf')>
<CFINCLUDE template="/cfide/library/libdebug.cfm">
<CFINCLUDE template="/cfide/library/libfile.cfm">
<CFSET server.udf=1>
</CFIF>
This is a small check per page run and it'll only be run once. I'm playing
with the server wide locking for server variables to avoid the need for
CFLOCK.

> What about putting them in a custom tag and then just calling the UDF's
you
> need? You could have all of your UDF's in a single file and call them as
you
> need them....
>
> <cf_UDF
>     GetFunctions="StringLimit, IntegerCount,
MyGrandmasFavoriteCookieRecipe,
> OneMoreFunction"
> >
>
> That way, you could keep them all in one place and use them in any file on
> the server. Having to include the code each time you need it sounds like
it
> might suck a little... kinda defeating the purpose?
>
> Anyway, looking forward to that functionality.... thanks for the info!
>
>
> Steve
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to