People may have covered this already, but unless you are including entire 
functions that have been properly scoped and the cfinclude is outside of a 
function, then no don't do it. For one thing if you use a cfinclude inside 
of a function, any variables declared within that include are now public. 
And its also a beast to maintain. 

As for the number of cfc's, look at what you are trying to do. Group 
functions together as long as they make logical or functional sense. In 
other words it depends. But one rule of thumb keep the cfc's very tight. 
Each CFC should only deal with one concern.

hth,
larry

On Thursday, July 5, 2012 11:30:44 AM UTC-4, Jason Allen wrote:
>
> I'm looking to migrate a bunch of spaghetti code to an organized cfc. 
> Before I start, I'm curious of any 'best practices' anybody could enlighten 
> me about. 
>
> Is it best to have few cfc's and compile as many functions into a single 
> cfc? Or is it ok to have dozens, if not hundreds of cfc's that are very 
> specific?
>
> Is it ok to use CFINCLUDE in a cfc? I have a few functions that have a 
> bunch of code and I'd rather "include" the code in just to make the CFC 
> itself thinner. 
>
> Can you use a 'function declared in a cfc' within another function 
> declared within that same cfc? Meaning, if I declare a function in a cfc, 
> can I use that function within another function declared after the first 
> one?
>
> Where do I put CFC files in OpenBD? How do I make my app initiate them?
>
>
>

-- 
online documentation: http://openbd.org/manual/
 http://groups.google.com/group/openbd?hl=en

Reply via email to