tracker issue : CF-3712125

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

A lot of member functions cannot be chained

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 02/22/2014

Components: Language

Versions: 11.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: PublicBeta / Final GM build

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 10

The member functions for query (and I presume struct and arrays etc) cannot be chained, because they don't return sensible values. This is almost certainly due to the implementation is purely a transliteration from the equivalent procedural functions. The member function implementation does not need to be so literal as this.

I'd say as a rule of thumb, where the current proocedural functions return a pointless/meaningless boolean, the member function should instead return the object itself.


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

Watson Bug ID:	3712125

External Customer Info:
External Company:  
External Customer Name: Adam Cameron.
External Customer Email:  
External Test Config: My Hardware and Environment details:



Pls explain the rationale behind "never fix". -- Adam
Comment by External U.
13333 | March 21, 2014 03:30:54 AM GMT
Chaining is really useful in other languages - i would have expected to be able to do this.
Vote by External U.
13339 | May 16, 2014 06:10:50 AM GMT
Comment by External U.
13334 | December 10, 2014 08:13:12 AM GMT
Please consider reopening this. Method chaining is a natural part of using member functions in other languages.
Comment by External U.
13335 | December 11, 2014 01:10:30 AM GMT
+1 //////////////////////////
Vote by External U.
13340 | December 11, 2014 01:10:56 AM GMT
I see this has changed to "to fix". Cool. But I *did* ask for an explanation as to why it was "never fix" in the first place. Doing this is an exercise in taking responsibility for your client communications, so I would really like an explanation of that initial decision. Also, WHENEVER you make a decision which is likely to disappoint your clients, you need to have the professional courtesy as to discuss it or at the very least explain yourselves. You really really need to work on your client comms. This needs to be articulated to everyone on your team. Currently it is very subpar. But cheers for reopening the ticket! :-)
Comment by External U.
13336 | December 11, 2014 01:37:10 AM GMT
And hopefully it goes without saying... if the result of calling a member function is a different type, and that new type usually has its own member functions, they should be chainable too: "1,2,3".listToArray().each(function(){}) ... and so on.
Comment by External U.
13337 | September 30, 2015 12:52:31 PM GMT
Hodor. Hodor. Hodor. Hodor. Hodor. Hodor. Hodor. Hodor. Hodor.
Vote by External U.
13341 | September 30, 2015 12:52:51 PM GMT
Vote by External U.
13342 | October 01, 2015 10:22:08 AM GMT
+1 ......................
Vote by External U.
13343 | October 03, 2015 08:11:00 PM GMT
This is 25+ chars so that I can upvote this issue.
Vote by External U.
13344 | October 08, 2015 03:56:49 PM GMT
This is a great idea. Many BIFs return rather arbitrary results (boolean? on operations that are really unlikely to fail??) so returning "this" object would make much more sense for member functions.
Vote by External U.
13345 | October 29, 2015 11:21:13 AM GMT
+1 * 1000000!!!! Language enhancements... please!!! :-)
Vote by External U.
13346 | October 29, 2015 03:30:03 PM GMT
Can you please confirm in what version of ColdFusion this is going to be implemented in. It says "to fix" but does not say which version.
Comment by External U.
13338 | January 25, 2016 08:27:54 AM GMT
Comment by Aaron N.
27293 | April 05, 2018 06:33:41 AM GMT