Tonight I played around with onMissingMethod, a cool new feature in ColdFusion 8. See Ben Nadel's entry

What I didn't realize and was surprised by - you can't rename these arguments. So consider this:

   view plainprintabout
 <cffunction name="onMissingMethod" access="public" returnType="any" output="false">
     <cfargument name="method" type="string" required="true">
     <cfargument name="args" type="struct" required="true">

While the method itself will run, the arguments above will not actually be used. You must name them as Ben describe's in his entry:

   view plainprintabout
 <cffunction name="onMissingMethod" access="public" returnType="any" output="false">
     <cfargument name="missingMethodName" type="string" required="true">
     <cfargument name="missingMethodArguments" type="struct" required="true">

As a side note - for the life of me I couldn't find any mention of onMissingMethod in the docs - neither the Developer's Guide nor the Reference. Can anyone else find it?

This is the code I'm using in a generic bean:

   view plainprintabout
 <cfcomponent name="Core Bean" output="false">
 
 <cffunction name="onMissingMethod" access="public" returnType="any" output="false">
     <cfargument name="missingMethodName" type="string" required="true">
     <cfargument name="missingMethodArguments" type="struct" required="true">
     <cfset var key = "">
     
     <cfif find("get", arguments.missingMethodName) is 1>
         <cfset key = replaceNoCase(arguments.missingMethodName,"get","")>
10          <cfif structKeyExists(variables, key)>
11              <cfreturn variables[key]>
12          </cfif>
13      </cfif>
14  
15      <cfif find("set", arguments.missingMethodName) is 1>
16          <cfset key = replaceNoCase(arguments.missingMethodName,"set","")>
17          <cfif structKeyExists(arguments.missingMethodArguments, key)>
18              <cfset variables[key] = arguments.missingMethodArguments[key]>
19          </cfif>
20      </cfif>
21      
22  </cffunction>
23  
24  </cfcomponent>

This let's me define a simple bean like so:

   view plainprintabout
 <cfcomponent output="false" extends="bean">
 
 <cfset variables.id = "">
 <cfset variables.username = "">
 <cfset variables.password = "">
 <cfset variables.name = "">
 <cfset variables.email = "">
 
 </cfcomponent>