> 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?

The usual method of using collections of functions is to group related
functions into individual libraries.  Then you use the language's include
directive to include the library file inline into the source code.  It's
common to be working with a function library and find yourself using
additional functions from the library.  Using a tag to just include the
functions you want, you'd have to keep appending these additional functions.

<cfinclude template="stringlib.cfm">
<cfinclude template="mathlib.cfm">
<cfinclude template="creditcardlib.cfm">

If you need to use the function libraries within different web sites on the
same server, then a good idea might be a tag to include the necessary
libraries.  That way they could be kept in a single location.

Of course it doesn't help you the next time you develop a site on a
different machine.  One nice thing about general purpose function libraries
is that they can often be written and then need very few modifications in
the future.  You just try to envision how the function may be used in
various situations then optimize and debug the heck out of it, put it in the
can, and then forget about it.

Jim


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to