Title:
The ability to define a subscope (structure) for instance variables created via cfproperty
| View in TrackerStatus/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: