tracker issue : CF-3337574

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

The ability to define a subscope (structure) for instance variables created via cfproperty

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Fuck You / Fuck You (Kevin.Cruz)

Created: 09/26/2012

Components: ORM Support

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

Duplicate ID:	CF-3130900

A generally accepted practice for OOP CF developers in CF8 and prior was to define bean attributes in a structure defined in the variables scope called 'instance' that was used to insulate the specific bean attributes that are expected to be returned outside of the CFC from truly private CFC variables.  While built-in ORM has been a godsend in regards to OOP CF development; for some reason it was decided by The Powers That Be that these instance variables we create be dropped straight into the variables scope.  This creates additional work for developers who use variable scoping in this manner by having to work around this limitation.

My suggestion is to add an optional property to the This scope in Application.cfc related to ORM configuration to accommodate a subscope defined by name that creates a structure in the variables scope where these instance variables would normally be created if an OOP developer were either not using the ORM functionality of working in older versions of ColdFusion.  If not defined, then the creation of bean properties would work as currently implemented, defining them in the variables scope so as to not break backwards compatibility.  If it were defined (e.g. "this.propertyScope = 'instance'") then the variables would be placed in a structure called 'instance' for all CFCs where the accessor value for the component is set to true.

Alternatively, this could also be defined per component by adding an attribute with a name such as "accessorscope" that would perform the same function but only on the bean which it is defined in.  I do have a preference towards an application level implementation, but the current implementation requires me to do extra, seemingly unnecessary coding on all of my projects and I don't have an understanding why this was implemented this way in the first place.

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

Watson Bug ID:	3337574

External Customer Info:
External Company:  
External Customer Name: Kevin.Cruz
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Well said. +1 -- Adam
Vote by External U.
17870 | September 26, 2012 04:42:45 PM GMT
+1, I'd previously filed #CF-3130900 w/ input from Adam. It was for a <cfproperty-level variablename="". However, I'm liking the Application.cfc-level THIS.accessorScope & <cfcomponent-level accessorscope="" as well.
Vote by External U.
17871 | September 27, 2012 02:34:22 AM GMT
Just noting that Vamseekrishna kindly noted that this functionality will in fact be considered in the next version ColdFusion. https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3130900 Thanks!, -Aaron
Comment by External U.
17867 | September 27, 2012 02:37:07 AM GMT
Thanks a lot for the feedback. I'm looking forward to the next version and I hope this functionality makes it.
Comment by External U.
17868 | September 27, 2012 10:56:40 AM GMT
This bug has been closed as a duplicate of CF-3130900. This enhancement will be considered for the next release.
Comment by Immanuel N.
17869 | December 04, 2014 05:43:24 AM GMT