Fuse (programming)
From Wikipedia, the free encyclopedia
This article may not meet the general notability guideline or one of the following specific guidelines for inclusion on Wikipedia: Biographies, Books, Companies, Fiction, Music, Neologisms, Numbers, Web content, or several proposals for new guidelines. If you are familiar with the subject matter, please expand or rewrite the article to establish its notability. The best way to address this concern is to reference published, third-party sources about the subject. If notability cannot be established, the article is more likely to be considered for redirection, merge or ultimately deletion, per Wikipedia:Guide to deletion. This article has been tagged since May 2008. |
A fuse is where the work of a Fusebox web application is done. They are small separate files that are called by the Fusebox to do one and only one task. Fuses start with dsp_, lay_, act_ or qry_ to separate out the display, layout, CFML and SQL parts of the code.
Display fuses (dsp_ prefix) and Layout fuses (lay_ prefix) are the only fuses that can present output to the client. Some CFML tags such as CFOUTPUT and sometimes CFIF are allowed, but the idea is to restrict these fuses to mainly HTML. This allows graphics and Web designers to edit them more easily than typical CF heavy files. Note the display may be in regular HTML for a browser, or WML for a WAP phone, or XML for a web service. In the latter cases Fusebox does not add any white space to your output, which saves many headaches when creating web services.
Action fuses (act_ prefix) on the other hand only contain CFML and cannot display output. They however may assemble data for display into variables that are used in later dsp_ files. This focus on CFML by action fuses eases debugging and reusability.
Query fuses (qry_ prefix) also can not display output, but unlike action fuses they are for SQL queries and other record set producing tags such as CFDIRECTORY. In addition to the query tag they might also use CFPARAM and CFQUERYPARM to validate their arguments but no other CFML processing. Keeping all the queries in one file type makes it easy to hand off SQL to a DBA for optimization or conversion to stored procedures. In fact some Fuseboxers use a fake query generating tag called CF_QuerySim(www.halhelms.com) to generate result sets even before the database design is complete!