On Thu, Jul 5, 2012 at 8:30 AM, Jason Allen <[email protected]> wrote:

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

Impossible to answer that question in the abstract other than to say group
things together that make sense to group together. General idea is to have
tight cohesion (objects that have a limited job and do it well) and loose
coupling (objects don't have tight dependencies on other objects and don't
know the inner workings of other objects).


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

As a rule, don't do that. "Thinner" isn't a valid goal. Readable,
self-contained code is.


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

Yes.


>
> Where do I put CFC files in OpenBD?
>

You can put them anywhere.


> How do I make my app initiate them?
>

You'd have to elaborate. Completely depends on what you're trying to
accomplish. CreateObject() or the new keyword is the general answer.

-- 
Matthew Woodward
[email protected]
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

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

Reply via email to