Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: andw928Posted on 2005-08-16 at 21:41:10ID: 14689088
It basically comes down to this, if you have multiple functions in a Coldfusion Component that you want to use on the same page request, then use <cfobject> or createobject(), otherwise, if you only have 1 function in the Coldfusion component or want to use only 1 function on a certain page request, then use <cfinvoke>.
There is a reason for this, when you have more than 1 function that you are invoking from a Coldfusion Component using <cfinvoke>, you are then really invoking the component twice for each of those functions. While, if you are using createobject() of <cfobject>, then you are invoking the component first, but leaving it open, therefore allowing you to call the functions of the component on that page request without closing and opening the component each time you call the function.
So by multiple innvocations, it means exactly what I just explained. So basically ask yourself this question:
Do I want to use more than 1 function from the .cfc on the current page?
-If yes, use <cfobject> or createobject().
-If no, use <cfinvoke>.