I tend to write my code in cfscript whenever possible, but
because not all tags are available within cfscript, I often have to
write wrapper functions for them. I also have a bunch of
miscellaneous, non-application-specific utility functions that I
use quite a bit.
My ideal CFC is one that is completely stand-alone. Totally
encapsulated. Something I could post here that would work for any
other ColdFusion programmer without any fuss. However, if I want to
use my wrapper functions and/or utility functions inside them, I
lose the "stand-alone-ness" of it, because all of a sudden it is
dependent on these external utility functions -- functions which,
in my opinion, should be part of ColdFusion itself. I could define
them in the cfc itself, but I don't want ten to twenty different
versions of the same functions floating around in my application.
Another option: I could require that they be passed in during the
init() method, but there you go again -- it's not standalone.
So, my question is, how important is encapsulation to you? Do
you think the benefit is so great that you would even avoid using
simple wrapper functions and utility functions inside cfc's, or are
you willing to strap on a few "dependencies" in order to write
cleaner, easier code inside them?