Fuse (programming)

From Wikipedia, the free encyclopedia

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!

[edit] See also

Fusebox (programming)

[edit] External links