Copy link to clipboard
Copied
I have an application running CF8. One of the CFCs is very large and breaks when trying to upgrade to a newer version of CF.
I use the functions in the CFC to build html docs that can be displayed or emailed. How should I go about refactoring this cfc to make it work?
Format is currently like this:
function - get order
stored procedure
function - get order details
stored procedure
function - display order
several hundred lines of html that get pulled back to the web page or emailed
Copy link to clipboard
Copied
I would split the CFC methods that make up your "model" (business logic) from those that provide content to views (display logic), especially if they might have access="remote".
Before going down that path, though, can you clarify what you mean by "breaks"? Specific errors would be helpful.
Copy link to clipboard
Copied
"
Branch target offset too large for short |
"
Copy link to clipboard
Copied
Googling that error message and "ColdFusion" together got me these possible solutions (actually these are only the first 5 or so results):
Branch target offset too large for short
http://www.coldfusionmuse.com/index.cfm/2007/9/28/Branch.Target.Offset
ColdFusion - Branch Target Offset Too Large for Short
Seems the most likely culprits are:
It's hard to say which one applies to you, because you haven't provided a stack trace. Read over the links (or Google the error message and read all of the results) and compare them to the first few lines of the error stack trace.
Copy link to clipboard
Copied
Thank you for the time.
I know that the problem I have is too many cffunctions with lots of lines of html formatting.
What I am trying to figure out is do I pull all the html and conditional formatting out of the cfcs and leave that in regular cfm files and just use the cfc to do the queries?