I've worked at places where the cfc files got to be 20 or 50 thousand lines of code long. I recall mentioning that I thought something seemed a little amiss in their design to let that happen. I also recall concluding that they really didn't want to hear that.

Anywhoo... use Java as an example. A cfc should represent an object. The cffunctions within are individual methods on that object. So in most apps, you'd have one cfc for "users", another one for "orders" and so forth. If "orders" gets to be way big, then you probably need to break it into "inventory" and "fulfillment", for example. Hopefully you get the idea, it hard to be specific without knowing the business process (which always comes first, btw, then the code).

Inside each cfc/object is the definition & data access methods germane to that "being". Getters, putters, deciders...

In brief, group your cfcs primarily according to the business taxonomy (people, places, things), which extend a few core cfcs that are dedicated to application function (login, security, logging, etc).

You can also leverage an existing framework and save tons of trial & error development. It's frequently faster, and exercises the learning muscles in a more productive way.

Al


On 6/17/2014 7:25 AM, Jason Allen wrote:
Do you prefer to keep as many functions in a single cfc as possible, or do you create many cfc's so that you have smaller, more readable chunks of code?
--
--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en

---
You received this message because you are subscribed to the Google Groups "Open BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

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

---
You received this message because you are subscribed to the Google Groups "Open BlueDragon" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to