I have some common UDFs and CFCs that I'd like to make available to all my controllers. I'm using Model-Glue 3. I've thought of several ways of doing so:
- Create a base controller that has
<cfinclude>'s to the UDFs and instantiates the CFCs. All other controller inherit from this controller. - Convert all UDFs to CFCs and use
ColdSpring.xmlto make the CFCs into beans. Then make it available to the controller using thebeansattribute inModelGlue.xml. - Store the UDFs and CFCs in the helpers folder and access them using the helpers scope. However, this looks like it was intended to be used by a view rather than a controller.
- Create a global
onRequestStartwhich will instantiate the CFCs and store them in theeventobject. Then the controllers will access the CFCs by grabbing them directly out of theeventobject.
My question is, what is the method used by most people to make a common set of UDFs and CFCs available to all controllers?