tracker issue : CF-3037006

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 74146:(Watson Migration Closure)Please add onMethodStart(methodName,methodArgs) and onMethodEnd(methodName,methodArgs) to the CFC specification

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): Jared Rypka-Hauer / Jared Rypka-Hauer (Jared Rypka-Hauer)

Created: 12/09/2008

Components: Language, CF Component

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 6

Duplicate ID:	CF-3687747

Problem:

Please add onMethodStart(methodName,methodArgs) and onMethodEnd(methodName,methodArgs) to the CFC specification. They would work very much like onMissingMethod(), only they would, if implemented in a CFC, fire just before and just after any method call to CFCs.

There may be a minor performance drop but CFC performance once implemented is not a problem. If a user applies them inappropriately, it would be no different than, for example, using lists instead of arrays... you DO have to know what you're doing sometimes.

The ability to trap method calls before and after a method would be invoked would be of IMMEASURABLE benefit to users of CFCs... anything from validation to being able to automatically return a reference to a CFC after calling a setter, with ONE CHANGE TO CODE, is an absolutely fantastic innovation.

The only reason I see this as so important is, well, at this point there is NO OTHER WAY to do this. With this feature, CFCs become even more powerful than they are at this point...

PLEASE!!!!!!!!!!

Method:

<cffunction name="onMethodStart">
    <cfargument name="methodName" />
    <cfargument name="methodArguments" />

    <cfif arguments.methodName IS "setUser">
        <cfset local.arg = arguments.methodArguments[1]>
        <cfif not isObject(local.arg)
                AND getMetaData(arg).name IS "User">
        <cfthrow message="you must pass in a User object!" />
    </cfif>
</cffunction>

<cffunction name="onMethodEnd">
    <cfargument name="methodName" />
    <cfargument name="methodArguments" />

    <cfif left(arguments.methodName,3) IS "set")>
        <cfreturn this />
    </cfif>
</cffunction>
Result:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3037006

External Customer Info:
External Company:  
External Customer Name: Jared Rypka-Hauer
External Customer Email: 08C411A143BC38A7992016B6
External Test Config: 12/09/2008

Attachments:

Comments:

-1, sorry. See discussion here: https://prerelease.adobe.com/r/?1b2951c24772438f8ab4db2d643cd4d3, specifically my position here: https://prerelease.adobe.com/r/?df46bd7acbcc4fd6983f38a6d6ceb91b. -- Adam
Vote by External U.
24431 | November 10, 2011 07:08:30 PM GMT
This bug has been voted..
Vote by External U.
24432 | November 10, 2011 07:08:31 PM GMT
This bug has been voted..
Vote by External U.
24433 | November 10, 2011 07:08:32 PM GMT
This would bring functionality to CFC's that I've been wanting for a Very, very long time. +1
Vote by External U.
24434 | November 10, 2011 07:08:34 PM GMT
Considering that this ER has encountered serious opposition from some of the "heavy hitters" in the forums, I would ask that anyone voting for it would please chime into the thread (URL provided below) and offer your use case for the consideration of the assembled braintrust? THANKS!!! https://prerelease.adobe.com/project/forum/thread.html?cap=87529BDA13744B3DB718E841890B9240&forid={A8760B70-42A5-45FC-8BA2-DFCF173A9580}&topid={D968AC75-939A-4316-9921-2A05FF409F71}
Vote by External U.
24435 | November 10, 2011 07:08:36 PM GMT
This bug has been voted..
Vote by External U.
24436 | November 10, 2011 07:08:38 PM GMT
Closing bug as a duplicate of CF-3687747.
Comment by Immanuel N.
24430 | December 04, 2014 05:35:19 AM GMT