Friday, May 9, 2008

Max Size for a CFC Method is 64K

I've seen this mentioned before but I ran into this today--the maximum size of a method (or <cffunction> if you prefer that nomenclature) is indeed 64K. Yes, this is something that should never happen, but in my defense it was a VERY easy to read, well segmented case statement, and after the initial two cases turned into four, it got a bit unwieldy. :-) Easy enough to fix with some private methods in the CFC that handle each case (and yes, there will be more apparently--gotta love ever-changing requirements), but it's nice that CF (actually this is a Java limitation when it comes down to it) doesn't let you get too nasty with your code.


Comments



It sounds like this section of code might be a good candidate for the strategy pattern. :)





This size limit is smaller than it was under CF7. When we trialled CF8 some of our monster legacy code fell over. This code definitely needs to be re-factored but this would be a major effort.


I imagine that this change reflects the update to the underlying JVM.



No comments: