Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFC Size - When is it too large?

Explorer ,
Mar 16, 2011 Mar 16, 2011

I was wondering if anyone had any insight or opinion on when a CFC is getting too large for its own good. We have a pretty complex application and have some CFCs with ove 12,000 lines of code and are about 500 KB in size. I know the code gets converted to java classes and it sort of looks like CF creates a separate class for each function, so maybe the overall size of the CFC isn't that big an issue. But I was wondering what someone more knowledgable than I would say.

585
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2011 Mar 16, 2011

"When is it too large?"

Turn around.  Look way way way way back in the distance back when your CFCs got bigger than about 1000 lines.

That's when they got too large.

Not from an operational point of view, but from a "your object model probably needs looking at" POV.

From a technical standpoint, there's no real corelation to be made between "amount of CFML code" and "amount of Java byte code it will end up being".  Every method is compiled into a separate class, so it's really the size of your methods rather than the size of your CFCs that would be the barrier here.

But that aside, how is it that you have CFC files that large?  I start cringing when mine go over about 1500 lines, and start thinking "time to recompose this".

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2011 Mar 16, 2011

Size doesn't matter, except that the bigger your file, the slower it runs.

Look at how you are using your cfc's.  If you are attempting OOP, are you sticking to the principle of one job per class?

If you are using cfc's as a container for udf's, see if you can analyse the extent to which your calling pages use more than one of the functions.  You may find ways to break up the cfc's so that your pages process more quickly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2011 Mar 16, 2011
LATEST

Size doesn't matter...

That's what the ladies keep telling me, but I think they are lying.

^_^

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources