Title: Message
Mike,
 
Fuses are quite different conceptually from fuseactions. A fuseaction is fundamentally a request to do something: validateUser, for example. This request must be translated into code, of course. These code files are called fuses. The smaller and more discrete the fuse is, the easier it is to debug, maintain, and reuse. So in the above example, the fuseaction, validateUser would translate into perhaps two fuses: qry_FindUser.cfm and act_ValidateLogin.cfm.
 
The job of qry_FindUser.cfm would be to simply return a recordset of user information based on information passed to it -- userName and password, say. The job of act_ValidateLogin.cfm is to read this record set and decide what to if the recordset returned any rows (in which case, the validation succeeded) or no rows (failure).
 
Here's the code:
 
<cfcase value="validateLogin">
  <cfinclude template="qry_FindUser.cfm" />
  <cfinclude template="act_ValidateLogin.cfm" />
</cfcase>
 
Sometimes a fuseaction needs to accomplish something that is already done by another fuseaction. Often the code for that fuseaction may lie in another circuit. (A circuit can be thought of as a grouping of like-minded fuseactions.) Rather than duplicate this code, or attempt to directly access the fuses, the primary fuseaction can simply ask the other fuseaction to perform an action. Here is an example of doing this by calling the Fusebox as a custom tag:
 
<cfcase value="checkout">
  <cfmodule
    template="#Fusebox.rootPath##self#"
    fuseaction="Inventory.checkStock"
    item="#attributes.chosenItem#" />
 <cfinclude template="act_Checkout.cfm" /> 
</cfcase>
 
This can also be handled a bit differently by using the Techspedition core file. In that case, you just add the fuseactions into a queue, like this:
 
<cfcase value="checkout">
  <cfset AddToQ( 'Inventory.checkStock' ) />
  <cfset AddToQ( 'Checkout.getUserInfo' ) />
</cfcase>
 
Either way will work perfectly fine for you. I use them both, depending on whether I want to define a sort of workflow (in which case I use the FuseQ stuff) or just want to run out and do something immediately, suspending current processing (in which case I use the <cfmodule> call). The latest edition of "ColdFusion Developer's Journal" has an article I wrote on calling the Fusebox recursively -- that is, as a custom tag.
-----Original Message-----
From: Mike [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 18, 2002 7:07 PM
To: [EMAIL PROTECTED]
Subject: Re: CFMODULE vs CFINCLUDE

I am still a little confused as to what is a higher level and low-level function.
 
BTW your Portal is a great learning tool!
----- Original Message -----
Sent: Saturday, May 18, 2002 6:44 PM
Subject: Re: CFMODULE vs CFINCLUDE

Hi Mike,
 
Generally in Fusebox, we have a distinction between low-level, private, atomic functions (called Fuses) and higher-level, public functions (called FuseActions). 
 
We use <cfinclude> to call the low-level Fuses, and <cfmodule> to call entire high-level FuseActions.
 
(There is also a new, quasi-proprietary, extension to the FB3 framework, called FuseQ, that's getting a fair bit of discussion at the moment.  It provides an alternative method for invoking entire FuseActions.  Watch this space to see if it becomes standardised.)
 
Does that make sense?
 
Thanks,
LeeBB

----- Original Message -----

From: Mike
 

Hello All,
 
I was looking at some example fusebox apps and was looking at Lee's Portal example.  Can someone let me know why Lee uses CFMODULE to include the template instead of CFINCLUDE.  I noticed this in out_portal.cfm is there a benefit to using one over the other?
 
Thank you
 
Mike
==^================================================================
This email was sent to: [EMAIL PROTECTED]

EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bWbH7I
Or send an email to: [EMAIL PROTECTED]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================
==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================

Reply via email to