Charlie, My reason for opting for cfobject is a bit unique. I am working with tech support at Web Assist for their eCart product. Currently, it does recognize CFC Queries as recordsets. I have noticed that Dreamweaver does recognize CFC Queries when using placing <!--- CFC Query ---> as a comment between <cfinvoke></cfinvoke> tags.
This made me think that WA eCart could recognize CFC Queries in the same way. However, I don't want to invoke my component each time I invoke one of its methods. Therefore, I was thinking of using cfobject to instantiate the component and cfinvoke to call the method and place the DW specific comment between the tags. I'm not even sure if Web Assist will implement such a compatability feature, but that is what I suggested to them. Is it possible to use createobject instead of cfobject and then use the variable name for the object as the component name in cfinvoke? Here is an example of what I am asking: <cfset gateway = createObject("component", "myCFC").init(application.dsn) /> <cfinvoke component="gateway" method="getRecordset" returnvariable="qRecordset"><!--- CFC Query ---></cfinvoke> Unfortunately, Dreamweaver doesn't even support using createObject or <cfobject>. When I place the DW comments between the <cfinvoke /> tags when specifying the component name as the cfobject name or createObject variable name Dreamweaver says that the component could not be found it and does not display the recordset in the Bindings tab of the Application panel. I submitted a feature request to Adobe, but who knows when they will even look at it and how much longer still until they do something about it (not a slant on Adobe's team, just a reality when dealing with a corporation that size). I'm wondering what CFEclipses support of these things is like? -Aaron On 10/26/06, Charlie Griefer <[EMAIL PROTECTED]> wrote: > i believe you'd need a <cfinvoke> for your init() method. > > so you need to insert <cfinvoke> before the one you have listed. > <cfinvoke component="gateway" method="init" dsn="#application.dsn#" /> > > just out of curiousity...any reason you want <cfobject> over the > createObject() way? I'm sure when it all boils down you'll have 6 of > 1, half-dozen of the other...but at the very least, the createObject() > allows the method chaining so it's easier to invoke the init() when > you first instantiate your CFC. > > I've also read (I think Sean C. said it) that the method chaining > syntax is a little "tighter" as it prevents any race condition issues > that may arise (especially if you're creating your CFC into the > application scope). > > On 10/26/06, Aaron Roberson <[EMAIL PROTECTED]> wrote: > > I have been creating and invoking my CFCs like such: > > > > <cfset gateway = createObject("component", > > "appName.path.cfc").init(application.dsn) /> > > <cfset qRecordset = gateway.getRecords() /> > > > > But I am considering using <cfobject> instead. Here is a comparison: > > > > <cfobject name="gateway" component="appName.path.cfc"> > > <cfinvoke component="gateway" method="getRecords" > > returnvariable="qRecordset"> > > > > The only problem is that I don't know how to pass the datasource name > > to the init function upon creating the object using <cfobject>. > > > > What am I missing? Any help would be appreciated. > > > > Thanks, > > Aaron > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:258140 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4