I don't know if these requests were directed at/to me or Sir Corfield.
Since he is our resident expert, I would defer you to his explanation of
when to use <class> and the why's and wherefore's.
Also Sean's code for the BlogCFC is probably a better example.
Even so, I'll do as I promised and display my code.
I know there is a limit to the length of the emails on here so I don't know
if all my attached code will make it.
----------fusebox.xml.cfm---------------
<!-- Somewhere inbetween the <circuit></circuit> chunk and the
<parameters></parameters> chunks -->
<!-- Here I am basically laying out all the components I will be using in my
app.
Also you can see here that I have a Folder under the wwwroot named Ali,
where I place all my FB apps. Underneath that I have the application
folder. Then within each application folder I have a com folder where all
the components go. Ideally I should further separate the components into
subfolders, but that's beyond the scope of this example. -->
<classes>
<class alias="States"
classpath="Ali.GAfb4CFC.com.statesManager"
type="component"
constructor="init" />
<class alias="Customers"
classpath="Ali.GAfb4CFC.com.dmsManager"
type="component"
constructor="init" />
<class alias="VIN"
classpath="Ali.GAfb4CFC.com.vinManager"
type="component"
constructor="init" />
<class alias="Dealer"
classpath="Ali.GAfb4CFC.com.dealerManager"
type="component"
constructor="init" />
<class alias="Rating"
classpath="Ali.GAfb4CFC.com.ratingsManager"
type="component"
constructor="init" />
<class alias="Policy"
classpath="Ali.GAfb4CFC.com.policyManager"
type="component"
constructor="init" />
<class alias="PolicyNumber"
classpath="Ali.GAfb4CFC.com.policyNumberManager"
type="component"
constructor="init" />
</classes>
-----myGlobals.cfm----
<!-- Not sure if I should be locking this. But I think in MX you don't need
to.-->
<cfif NOT StructKeyExists(application,"appInitialized")>
<cfset application.appInitialized = 0>
</cfif>
--- circuit.xml.cfm (in the controller folder)----
<!-- before I define all my fuseactions, here's where I instantiate the
components only once. Thereafter in my fuseactions I can <invoke> any of
these components, as long as I reference them as "application.componentName"
in the object parameter".
<prefuseaction>
<if condition="application.appInitialized EQ 0">
<true>
<instantiate
object="application.statesManager"
class="States"
arguments="request.DSN1"/>
<instantiate object="application.dmsManager"
class="Customers"
arguments="request.DSN2"/>
<instantiate object="application.vinManager"
class="VIN"
arguments="request.DSN4"/>
<instantiate
object="application.dealerManager"
class="Dealer"
arguments="request.DSN1"/>
<instantiate
object="application.ratingsManager"
class="Rating"
arguments="request.DSN1"/>
<instantiate
object="application.policyManager"
class="Policy"
arguments="request.bcc,request.DocsFolderGA,request.GAReportingFile,request.
GAIDCard,request.GAEvidenceOfIns,request.GASorryFile"/>
<instantiate
object="application.policyNumberManager"
class="PolicyNumber"
arguments="request.DSN1"/>
<set name="application.appInitialized"
value="1"/>
</true>
</if>
</prefuseaction>
>>>Subject: Fwd: cfc's and FB4.1
>>>From: Sean Corfield <[EMAIL PROTECTED]>
>>>Date: Wed, 6 Apr 2005 17:51:05 -0700
>>>Thread:
>>>http://www.houseoffusion.com/cf_lists/index.cfm/method=messages&threadid=
>>>1255&forumid=12#6699
>>>If you use the <instantiate> verb in circuit.xml, then <class> is
>>>required in fusebox.xml. If you manually instantiate the CFCs in
>>>fusebox.init.cfm or within a fuse then <class> is not required.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:12:6701
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/12
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:12
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.12
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54