RE: Best way to access CFC's?

2004-11-30 Thread Andy Mcshane
: www.scout7.com -Original Message- From: Dave Carabetta [mailto:[EMAIL PROTECTED] Sent: 29 November 2004 17:47 To: CF-Talk Subject: Re: Best way to access CFC's? On Mon, 29 Nov 2004 12:39:35 -0400, Andy Mcshane [EMAIL PROTECTED] wrote: Starting to update a site by converting code to CFC's

RE: Best way to access CFC's?

2004-11-30 Thread Andy Mcshane
(0)121 323 2010 Email: mailto:[EMAIL PROTECTED] Website: www.scout7.com -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: 29 November 2004 18:29 To: CF-Talk Subject: Re: Best way to access CFC's? CFINVOKE and createObject are very different beasts. CFOBJECT

RE: Best way to access CFC's?

2004-11-30 Thread Andy Mcshane
] Website: www.scout7.com -Original Message- From: Joe Rinehart [mailto:[EMAIL PROTECTED] Sent: 29 November 2004 19:16 To: CF-Talk Subject: Re: Best way to access CFC's? If you're component is stateful, you'll want to invoke methods on the same instance of the component instead

Re: Best way to access CFC's?

2004-11-30 Thread Deanna Schneider
PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, November 30, 2004 4:28 AM Subject: RE: Best way to access CFC's? Thanks, that makes it a little clearer. Now for the newbie dumb question, how does the code know where to find the components? i.e. !--- Instantiate a component that adds

RE: Best way to access CFC's?

2004-11-30 Thread Andy Mcshane
] Website: www.scout7.com -Original Message- From: Deanna Schneider [mailto:[EMAIL PROTECTED] Sent: 30 November 2004 13:19 To: CF-Talk Subject: Re: Best way to access CFC's? In that example, it will look in the directory of the calling template. The component part of the call tells

Re: Best way to access CFC's?

2004-11-29 Thread Dave Carabetta
On Mon, 29 Nov 2004 12:39:35 -0400, Andy Mcshane [EMAIL PROTECTED] wrote: Starting to update a site by converting code to CFC's, anyone have any thoughts on what is the best or most efficient way to access a CFC? Is it better to use CFInvoke or should I use CreateObject? Which method is

Re: Best way to access CFC's?

2004-11-29 Thread Barney Boisvert
CFINVOKE and createObject are very different beasts. CFOBJECT and createObject are the same, but CFINVOKE creates and instance of the CFC, calls the specified method on it, and then lets the instance disappear, with no hope of holding on to it for future reuse. Here's two examples of creating an

Re: Best way to access CFC's?

2004-11-29 Thread Sean Corfield
On Mon, 29 Nov 2004 10:29:26 -0800, Barney Boisvert [EMAIL PROTECTED] wrote: CFINVOKE and createObject are very different beasts. CFOBJECT and createObject are the same, but CFINVOKE creates and instance of the CFC, calls the specified method on it, and then lets the instance disappear, with

RE: Best way to access CFC's?

2004-11-29 Thread Andy Ousterhout
Why would you do that? -Original Message- From: Sean Corfield. Unless you specify a component *reference* in cfinvoke rather than a component name: cfset t = createObject(component, test) / cfinvoke component=#t# method=testMethod returnvariable=r / --

Re: Best way to access CFC's?

2004-11-29 Thread Barney Boisvert
Sure enough. Can you tell I've never used CFOBJECT or CFINVOKE, ever? I'm curious. Why would you want to type this: cfinvoke component=#o# method=testMethod returnvariable=r cfinvokeargument ... / /cfinvoke as opposed to this: cfset r = o.testMethod( ... ) / I know you hate my i

Re: Best way to access CFC's?

2004-11-29 Thread Joe Rinehart
If you're component is stateful, you'll want to invoke methods on the same instance of the component instead of continually creating new instances. !--- Instantiate a component that adds two numbers --- cfset myAdder = createObject(component, addsTwoNumbers) / !--- Set first number --- cfinvoke

RE: Best way to access CFC's?

2004-11-29 Thread Andy Ousterhout
Why wouldn't I just state: CFSET myAdder.setNumberOne(Number=2) / This seems much more readable. Andy -Original Message- From: Joe Rinehart [mailto:[EMAIL PROTECTED] Sent: Monday, November 29, 2004 1:16 PM To: CF-Talk Subject: Re: Best way to access CFC's? If you're component

Re: Best way to access CFC's?

2004-11-29 Thread Matthew Drayer
We started off writing all our component method calls inline -- ie: component.method(argument1, argument2), but we quickly found that 1. It was sometimes hard to follow what was going on due to the squished up nature of the code. 2. Having to maintain the proper order of argument declaration

Re: Best way to access CFC's?

2004-11-29 Thread Dave Carabetta
On Mon, 29 Nov 2004 10:29:26 -0800, Barney Boisvert [EMAIL PROTECTED] wrote: CFINVOKE and createObject are very different beasts. CFOBJECT and createObject are the same, but CFINVOKE creates and instance of the CFC, calls the specified method on it, and then lets the instance disappear, with

Re: Best way to access CFC's?

2004-11-29 Thread Sean Corfield
On Mon, 29 Nov 2004 11:05:44 -0800, Barney Boisvert [EMAIL PROTECTED] wrote: I'm curious. Why would you want to type this: cfinvoke component=#o# method=testMethod returnvariable=r cfinvokeargument ... / /cfinvoke as opposed to this: cfset r = o.testMethod( ... ) / Me?

RE: Best way to access CFC's?

2004-11-29 Thread Andy Ousterhout
Do you know that you can name your arguments in the compenent.method(arg2=1, arg1=2)? -Original Message- From: Matthew Drayer We started off writing all our component method calls inline -- ie: component.method(argument1, argument2), but we quickly found that 1. It was sometimes hard to

Re: Best way to access CFC's?

2004-11-29 Thread Jochem van Dieten
Barney Boisvert wrote: CFINVOKE and createObject are very different beasts. CFOBJECT and createObject are the same, but CFINVOKE creates and instance of the CFC, calls the specified method on it, and then lets the instance disappear, with no hope of holding on to it for future reuse. What if

RE: Best way to access CFC's?

2004-11-29 Thread Andy Ousterhout
Thanks. I was wondering if you had some trick up your sleeve. Andy -Original Message- From: Sean Corfield On Mon, 29 Nov 2004 11:05:44 -0800, Barney Boisvert [EMAIL PROTECTED] wrote: I'm curious. Why would you want to type this: cfinvoke component=#o# method=testMethod

RE: Best way to access CFC's?

2004-11-29 Thread Ben Rogers
2. Having to maintain the proper order of argument declaration was a pain in the neck. You can pass arguments by name when calling UDFs and component methods using the dotted syntax: cfset myObject = createObject(component, test) cfset result = myObject.sayHello(message=Hello, name=ben)

Re: Best way to access CFC's?

2004-11-29 Thread Matthew Drayer
I did not know that, no. Thanks for the tip. Matt Do you know that you can name your arguments in the compenent.method(arg2=1, arg1=2)? ~| Special thanks to the CF Community Suite Silver Sponsor - CFDynamics

Re: Best way to access CFC's?

2004-11-29 Thread Barney Boisvert
CFINVOKE still isn't letting you hold onto the instance, it's via some other external means. Yes it's splitting hairs. You could get around it if the method serialized 'this' and stored it somewhere for later recall as well. cheers, barneyb On Mon, 29 Nov 2004 21:54:22 +0100, Jochem van Dieten

RE: Best way to access CFC's?

2004-11-29 Thread Dave Watts
CFINVOKE and createObject are very different beasts. CFOBJECT and createObject are the same, but CFINVOKE creates and instance of the CFC, calls the specified method on it, and then lets the instance disappear, with no hope of holding on to it for future reuse. What if the method you

Re: Best way to access CFC's?

2004-11-29 Thread Robert Everland III
What about putting CFC's into the application scope? That way when calling one CFC from another CFC, you don't need to use cfinvoke. You also can use it when you do cfimport. Anyone have any experience doing something like that? Bob Everland