Search code examples
coldfusionchainingmethod-chainingcoldfusion-11

Return type for method chaining


What is the return type when using method chaining? any seems to be too generic.

<cffunction name="get" output="false" returntype="any">
   <cfargument name="BossID" type="string" required="false" default="All">
   ...
   <cfreturn this>
</cffunction>

Solution

  • Well think it through: what is it you're returning? You're returning the object itself. So... what sort of object is that? It's the name of the component.