tracker issue : CF-3687747

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

Baked in AOP for component request lifecycle

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): Steven Neiland / Steven Neiland (Steven Neiland)

Created: 12/24/2013

Components: Language, CF Component

Versions: 10.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: Final /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 3

Per my notes on this article http://www.neiland.net/blog/article/feature-idea-for-coldfusion/ create option before/after processing functions in the request lifecycle of a component method invokation.

onCFCStart, onMethodStart, onMethodEnd and onCFCEnd

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

Watson Bug ID:	3687747

External Customer Info:
External Company:  
External Customer Name: sneiland
External Customer Email:  
External Test Config:

Attachments:

Comments:

+1. I think baking AOP hooks into the language makes a lot of sense. -- Adam
Vote by External U.
13798 | December 24, 2013 12:43:45 PM GMT
I use this type of functionality in FW/1 for security checks before every function in the cfc is ran as well as data scrubbing in the suggested onMethodStart and response handling / message transportation in the suggested onMethodEnd. This would allow for the main method to be cleaner as well as eliminate redundant code that is copied amongst functions.
Vote by External U.
13799 | December 25, 2013 10:01:34 PM GMT
This could be very handy, but I would go one further and suggest aroundMethod and aroundCFC as well. Of course, it would probably need to come with a server, application, and CFC-level flag to enable and disable the functionality so it doesn't interfere with frameworks like ColdBox that already provide implicit pre/post/around AOP-style functionality.
Vote by External U.
13800 | December 29, 2013 05:06:51 PM GMT
Would there also be any benefit in adding a cfc specific onError?
Comment by External U.
13793 | December 31, 2013 06:39:42 AM GMT
Interesting idea there, Chris. Might be an idea as a separate ticket? It'd be less work I should think, and perhaps might strike a chord with more people? -- Adam
Comment by External U.
13794 | December 31, 2013 07:08:32 AM GMT
Added as a separate request but if Steven's request was implemented I think it would make sense to add in as well. https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3688456
Comment by External U.
13795 | December 31, 2013 08:50:01 AM GMT
Relevant: (https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3688456) Rupesh Kumar (CF Team): We will consider AOP as a larger feature for the next release - 11:58:22 PM GMT+00:00 Jan 16, 2014
Comment by External U.
13796 | January 17, 2014 04:17:54 AM GMT
Relevant bugs - https://watsonexp.corp.adobe.com/#bug=CF-3042139 - https://watsonexp.corp.adobe.com/#bug=CF-3688456 (Comment added from ex-user id:sandeepp)
Comment by Adobe D.
13797 | July 02, 2014 05:09:15 AM GMT