At the risk of getting into a style debate, I find having the CFINVOKEARGUMENT tags with all of their arguments as a sub of the main CFINVOKE (either without the component attribute or with it set to #this#) to be cleaner.

<cfinvoke method="SP_Order_Get" returnvariable="qGetOrderInfo">
   <cfinvokeargument name="Order_ID" value="#Order_ID#">
   <cfinvokeargument name="Order_Method" value="#Order_Method#">
   <cfinvokeargument name="Item_Status" value="7">
</cfinvoke>

<CFSET qGetOrderInfo=SP_Order_Get(Order_ID, Order_Method,7)>

<CFSET qGetOrderInfo=SP_Order_Get(Order_ID="#Order_ID#", Order_Method="#Order_Method#",Item_Status=7)>

Of the three, I can see what's arguments and their values faster in the first. The second is smallest code wise, but no direct reference is made to which value means what. The final is just long and a pain to read through to get a specific value.
If they all run the same speed and have the same server impact, then the point is moot.

>I'm curious why you think this:
>
><cfinvoke component="searchService" method="findUser"
>returnVariable="userQuery">
> <cfinvokeargument name="searchstring" value="#form.searchstring#" />
> <cfinvokeargument name="detailLevel" value="full" />
></cfinvoke>
>
>is cleaner than this:
>
><cfset userQuery = searchService.findUser(form.searchString,"full") />
>
>I find it much easier to scan and see what's happening in the second example
>because it seems to have a lot less syntactic 'noise'.
>
>Spike
>
>--------------------------------------------
>Stephen Milligan
>Code poet for hire
>http://www.spike.org.uk
>
>Do you cfeclipse? http://cfeclipse.tigris.org
>
>
>
>
>>>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to