The cfobject
tag can create a ColdFusion component (CFC) object.
<cfobject name = "variable name" component = "component name">
cfcollection,
cfcomponent,
cfexecute,
cfindex,
cfreport,
cfsearch,
cfwddx
Executing operations on a CFC object executes CFML code that implements the CFC's method in the CFC file. Using this tag to instantiate a component returns a ComponentProxy object that can delegate control to a CFC page.
<!--- separate instantiation and method invocation; permits multiple invocations --->
<cfobject name="quoteService" component="nasdaq.quote"> <cfinvoke component="#quoteService#" method="getLastTradePrice" symbol="macr" returnVariable="res"> <cfoutput>#res#</cfoutput><br> <cfinvoke component="#quoteService#" method="getLastTradePrice" symbol="mot" returnVariable="res"> <cfoutput>#res#</cfoutput>