Title:
Bug 73978:(Watson Migration Closure)One of the biggest sources of confusion and err for developers transitioning from introductory ColdFusion into CFC-driven application development is scope ambiguity
| View in TrackerStatus/Resolution/Reason: Closed/Deferred/
Reporter/Name(from Bugbase): David McGuigan / David McGuigan (David McGuigan)
Created: 12/03/2008
Components: Language
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 6
Problem:
One of the biggest sources of confusion and err for developers transitioning from introductory ColdFusion into CFC-driven application development is scope ambiguity. I see it all day long and there are countless community blogs about it.
Summary:
A CFC’s variables scope is its private internal storage.
A CFC’s "this" scope is its publicly-accessible internal storage.
A CFC function’s local scope is its temporary, per-function-call, private internal storage.
Since we’re already introducing the new local. syntax, it’s an opportune time to introduce more self-describing and appropriate "variables" and "this" scope syntax for CFCs.
New
<cfset public.variable = value /> ( equivalent of this.variable )
and
<cfset private.variable = value /> ( equivalent of variables.variable )
syntax would be a strong improvement to the current CFC implementation. It should become the recommended practice ( and would likely be adopted immediately ) and can easily co-exist with the current syntax ( which becomes deprecated ).
This would solve a lot of problems and is completely consistent with local. and the access conventions of cffunction definitions, as well as providing a 10 second learning curve.
Method:
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3036963
External Customer Info:
External Company:
External Customer Name: David McGuigan
External Customer Email: 5E0D54C04462BF5E992016B6
External Test Config: 12/03/2008
Attachments:
Comments: