Question
To create an object or not?
I was wondering what the better method of utilizing a
component was. I know
if you want to use multiple instances of a component it is better to create
an object and use it to invoke various methods. However, if only using one
method of a component, its it better to just invoke the component directly?
<cfinvoke component="cfc.my.component" method="getStuff"
returnvarible="myStuff"/>
What is the benefits and drawbacks for invoking a method directly verses
creating a cfobject.
And while on the topic, which is better?
<cfobject name="MyComponent" component="cfcs.my.component">
or
<cfscript>
createObject("MyCompoent","cfcs.my.component")
</cfscript>
Again, what are the benefits and drawback of each. I am more familiar with
the first using <cfobject> but I see the second more and more.
--
Wally Kolcz
MyNextPet.org
Founder / Developer
586.871.4126
if you want to use multiple instances of a component it is better to create
an object and use it to invoke various methods. However, if only using one
method of a component, its it better to just invoke the component directly?
<cfinvoke component="cfc.my.component" method="getStuff"
returnvarible="myStuff"/>
What is the benefits and drawbacks for invoking a method directly verses
creating a cfobject.
And while on the topic, which is better?
<cfobject name="MyComponent" component="cfcs.my.component">
or
<cfscript>
createObject("MyCompoent","cfcs.my.component")
</cfscript>
Again, what are the benefits and drawback of each. I am more familiar with
the first using <cfobject> but I see the second more and more.
--
Wally Kolcz
MyNextPet.org
Founder / Developer
586.871.4126