-
1. Re: <cfinvoke component="12robots" method="isItEvil()">
12Robots Oct 26, 2012 7:20 PM (in response to Dan Bracuk)There, of course, is one other alternative.
Jason
-
2. Re: <cfinvoke component="12robots" method="isItEvil()">
BKBK Oct 28, 2012 2:14 AM (in response to 12Robots)12Robots wrote:
There, of course, is one other alternative.
Naturally. <cfcomponent extends="12Robots">
-
3. Re: <cfinvoke component="12robots" method="isItEvil()">
Adam Cameron. Oct 28, 2012 8:38 AM (in response to BKBK)Naturally. <cfcomponent extends="12Robots">
You'd still have to invoke the component somehow.
I presumed he meant the new operator.
And, indeed, if it's a persistent component, then there's entityNew() too.
--
Adam
-
4. Re: <cfinvoke component="12robots" method="isItEvil()">
Dan Bracuk Oct 28, 2012 8:56 AM (in response to BKBK) -
5. Re: <cfinvoke component="12robots" method="isItEvil()">
WolfShade Oct 29, 2012 12:13 PM (in response to 12Robots)What about using cfinvoke for queries? All of the projects I've worked on for the current client, I'd say probably 95% of the component/methods I've seen or typed are just for queries.
^_^
-
6. Re: <cfinvoke component="12robots" method="isItEvil()">
Dan Bracuk Oct 29, 2012 12:38 PM (in response to WolfShade)The fact that the method returns a query is not relevent. For me, what would be more relevent is the number of functions in the cfc that are going to be called. If it's one, then cfinvoke is fine. If it's more than one, cfinvoke is inefficient because it creates a new object every time.
-
7. Re: <cfinvoke component="12robots" method="isItEvil()">
WolfShade Oct 29, 2012 12:43 PM (in response to Dan Bracuk)(shrug) Some components have 2-3 functions, some components have 10 or so functions. Some of the queries are quite large, most of them are just a few lines.
^_^
-
8. Re: <cfinvoke component="12robots" method="isItEvil()">
Adam Cameron. Oct 29, 2012 12:58 PM (in response to WolfShade)You're talking about the return value, not what the <cfinvoke> actually does.
And why would you use:
<cfinvoke component="SomeComponent" method="someMethod" returnvariables="someVariable">
When you could just do this:
<cfset someVariable = new SomeComponent().someMethod()>
<cfinvoke> is just a sh!tty, ugly, always unnecessary syntax construct. It's a reminent from when the thinking in CFML was "it's a tag-based language, everything must be done via tags", which was always an illconceived approach to implementing the language.
--
Adam
-
9. Re: <cfinvoke component="12robots" method="isItEvil()">
WolfShade Oct 29, 2012 2:02 PM (in response to Adam Cameron.)For the project I'm currently working on, I just switched all the cfinvokes over to variable = new components.componentName().methodName(args) and must admit that reducing code from 10 lines to 3 is pretty nice and easy to read.
I'm sure I'll expand into different things as time goes on.
Thanks, guys.
^_^
-
10. Re: <cfinvoke component="12robots" method="isItEvil()">
12Robots Oct 29, 2012 2:34 PM (in response to Adam Cameron.)Actually, the other alternative I was refering to was to get a decent hosting provider.
jason
-
11. Re: <cfinvoke component="12robots" method="isItEvil()">
Dan Bracuk Oct 29, 2012 2:41 PM (in response to Adam Cameron.)Regarding
"
And why would you use:
<cfinvoke component="SomeComponent" method="someMethod" returnvariables="someVariable">
When you could just do this:
<cfset someVariable = new SomeComponent().someMethod()>"
In Dreamweaver, which I use, the former would kick in the autocomplete feature, the latter would not.
Plus, the latter syntax is new to me. I'm used to creating the object first and then calling the variable. I haven't tried it, but I'm not even sure the latter syntax would work. I might try it later.
-
12. Re: <cfinvoke component="12robots" method="isItEvil()">
Adam Cameron. Oct 29, 2012 2:42 PM (in response to 12Robots)Oh you and your lateral thinking...
;-)
--
Adam



