tracker issue : CF-3685532

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

Adding an attribute to target instances with implicit setters and getters

| View in Tracker

Status/Resolution/Reason: To Fix//

Reporter/Name(from Bugbase): Aaron Martone / Aaron Martone (Aegis Kleais)

Created: 12/17/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 / Windows 7 SP1 64-bit

Vote Count: 1

I love implicit setters and getters, however they are not currently capable of detecting whether component properties are being placed into a container object.  For example, I use:

<cfset variables.my = {} />

I am proposing an attribute like: instancePrefix so I could write:

<cfcomponent accessors="true" instanceprefix="my" ...

And when CF goes to create Getters and Setters, it will access/mutate on variables.my rather than variables.

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

Watson Bug ID:	3685532

External Customer Info:
External Company:  
External Customer Name: Aegis Kleais
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Passing bug to team for review (Comment added from ex-user id:vnigam)
Comment by Adobe D.
13828 | December 17, 2013 01:56:51 PM GMT
+1. This drives me crazy when I'm writing CFCs. I use a similar practice of putting component variables into a struct so I can return the whole set of properties in a getMemento() method.
Vote by External U.
13832 | December 17, 2013 08:30:08 PM GMT
Alternately, give us a getMemento() BIF that returns a struct containing only the variables (not the component's methods) or some other way to do that.
Comment by External U.
13829 | December 17, 2013 08:33:24 PM GMT
@Carl I agree. I don't like inheriting from a base class that has the getMemento() in it just to get that functionality. I'd love for that to be implicitly created. Good add!
Comment by External U.
13830 | December 18, 2013 08:59:38 AM GMT
This is a risky change to be taken up at this stage since it will require changes in quite a lot of features as well. To be considered for the next release.
Comment by Rupesh K.
13831 | January 02, 2014 03:14:38 AM GMT