I was refactoring a CFC last night, and realized that since CF doesn't
have nulls, method calls within methods can be a little ugly.

My invocations (within a method) ended up looking like this (hardly
prettier than my un-factored code):

<cfinvoke method="qryHelper" returnvariable="myQuery">
  <cfinvokeargument name="sqlColumns" value="definition"><!---
required in containing method --->
  <cfinvokeargument name="termKey" value="#termKey#"><!--- required in
containing method --->
  <cfif isdefined("type")><cfinvokeargument name="type"
value="#type#"></cfif><!--- not required in containing method --->
  <cfinvokeargument name="clearCache" value="#clearCache#"><!---
required in containing method --->
</cfinvoke>

Am I going about this the wrong way? I'd sure like to be able to use
myMethod(sqlColumns=sqlColumns termKey=termKey ...) syntax, and not
have to use those conditionals for values that may or may not be
defined.

Thanks,
Jamie


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to