If your CFC deals with one entity, and each of those 12 methods do
something with that entity, I really don't see the need to split the
file up. Someone said if your file is longer than 2 pages but I have
seen queries (that cannot be rewritten) take up one page - leaving
little room for anything else following that rule.
If I am dealing with an entity I want to look in one place for its
methods - preferably a CFC or custom tag, not lots of little files.
You can also chain statements on single lines, or have them separated
out, with a block of comments here and there to explain just what is
going on. Stipulating "rules" can lead to a myriad of undesirable
outcomes (eg: no comments, chained commands, etc) as people seek to
satisfy those rules, which is why I like to keep it very simple. Does it
work is a good first rule to satisfy.
Someone else mentioned an object should do one thing - I'd say they
should *deal* with one thing (entity), and a _method_ should *do* one
thing. Get too rigid after that and you're spending too much time not
completing the project :-)
Just imo
Aaron
Jim Cassata wrote:
oh yeah works fine. It's just that I am going through the process of using CFCs
to separate business logic from presentation, and am trying to avoid some of
the rewrites ahead of me by getting up on good practices. Some info I can get
from books and web, but some I can't.
----- Original Message ----
From: Aaron DC <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, March 4, 2007 4:04:04 PM
Subject: Re: [CFCDEV] how much is too much?
I have a simple first rule: Does it work?
HTH
Aaron
Jim Cassata wrote:
Is there a point where a single cfc should be split into smaller pieces because
of size? I have a cfc with 12 methods in it at 1000 lines and about 20K. Just
thought it best to ask, as I haven't found this subject covered in any blogs or
books I have.
Thanks.
Jim
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]