tracker issue : CF-3559652

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

Improve CFML's OO-ness

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

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

Created: 05/14/2013

Components: Language

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: 9

G'day:
I think it’d be timely for CFML to retask most of its type-specific functions as object methods. As Railo has done.  EG:


keys = myStruct.keyList();
length = myArray.len();
result = myXml.search(xpath);
// etc


At the same time, promote all these methods to be first class, so they can be used as callbacks. Currently if one wants to have a function to - for example - uppercase each element of an array, one cannot simply give ucase() as a callback, one needs to wrap it in a UDF. Which isn’t the end of the world, but it’s just... something that would be nice not to have to do.

I also like how in languages like Javascript "even literals are objects", so one can do this:


"G’day World!".length();


This is not something one would generally do, but it demonstrates an architectural elegance that CFML doesn’t have at the moment.

[...]

I think it’s a mis-step in the language to add OO to it for developer-written code, but not embrace OO in the language itself. It leaves CFML being a bit of a mishmash.

I’m not suggesting getting rid of the more procedurally-oriented versions of the functionality, because a lot of ppl will still be coding that way; but this should not prevent CFML additionally moving more towards OO itself.

This might not be an exciting feature for IT Managers (although if they’d probably already expect it to be the case), but for the people who seem to do most of ColdFusion’s marketing - the vocal part of the dev community - this would be a significant feature.

-- 
Adam

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

Watson Bug ID:	3559652

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

Attachments:

Comments:

This feature would definitely improve my day to day cf usage.
Vote by External U.
15422 | May 14, 2013 03:59:18 AM GMT
I would love to see features like those requested to be incorporated into CF.
Vote by External U.
15423 | May 14, 2013 04:56:38 AM GMT
I like this incremental approach toward OO while keeping the old functionalities intact. +1
Vote by External U.
15424 | May 14, 2013 05:04:51 AM GMT
Vote must be between 25 and 4000 characters
Vote by External U.
15425 | May 14, 2013 06:52:22 AM GMT
I've been wanting Adobe to do this since CFMX was in beta. I argued hard when the image functions were released that it made much more sense to use an OO approach instead of polluting the CF namespace with all those functions.
Vote by External U.
15426 | May 14, 2013 08:15:11 AM GMT
I am not too interested in most of the new "features" Adobe adds in each release. However, it is this kind of improvement alone that would cause me to upgrade. We started playing Railo precisely for this exact bit of syntactic sugar and would love to see this implemented.
Vote by External U.
15427 | May 14, 2013 12:50:04 PM GMT
+1 This is possibly the best improvement that Adobe can make in the short term. *Must* implement IMO!
Vote by External U.
15428 | June 16, 2013 03:36:04 AM GMT
This enhancement would allow coldfusion users to move to a fully OOP framework rather than maintaining the entire ability and structure of the language as a mental model. Referencing object methods is an intuitive and efficient way for programmers. (See: All the books)
Vote by External U.
15429 | June 24, 2013 04:57:07 PM GMT
Just to clarify is this bit part of the "fix" here: "At the same time, promote all these methods to be first class"? -- Adam
Comment by External U.
15419 | January 04, 2014 05:26:35 AM GMT
+1 this would make my day-to-day work easier. I think it would also help new developers coming over from other OO languages find ColdFusion a bit easier to understand, as they will likely expect BIFs to be OO.
Vote by External U.
15430 | January 04, 2014 11:17:18 AM GMT
Yes :-)
Comment by Rupesh K.
15420 | January 06, 2014 09:10:19 AM GMT
COOL! -- Adam
Comment by External U.
15421 | January 06, 2014 09:32:52 AM GMT