<snip>
I think components still make the most reusable choice for things like
this.
I throw all my utility type functions into one cfc and call the correct
function according to what is required, even if no input is required it
still has the desired affect of doing xyz. These don't change often so I
normally put them in the application scope
<cfset application.utilities = CreateObject("component",
"components.utilities").init()>
Then just call the required function when needed.
<cfoutput>Hi visitor, the phrase of the day is
#application.utilities.phraseOfDay()#<cfoutput>
</snip>
That might make sense for some things, but if you don't have enough of
these items to justify a cfc then it's overkill. Also, what if it is
something that isn't used everywhere or very often? Then you have the
code taking up space in memory that is rarely used. CFCs and custom
tags both have their place. I believe that in this case the custom tag
is the better bet.
There are also other advantages to custom tags. When our group creates a
custom tag for our use, generally one of us also generates the changes
for cfeclipse/homesite 5.5+/etc so those custom tags are actually
recognized by the ide and can provide help/tag insight. Not so easy
with a cfc (as far as I know, I could be wrong).
Steve
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333647
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm