Hi fun and learning,

In short, variables created via the cfproperty|property-generated setters (in 
CF9) are private-to-the-CFC.

I recommend reading these docs:

cfproperty|property: 
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7e0b.html

Implicit Get and Set Functions: 
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0999c-7ff5.html#WS1E722CDD-3AA0-4e17-86DB-EF6D12FC6750

Also, please note:
- "Component properties you assign with the set method are in the Variables 
scope that is private to the CFC. You can get or reset the properties only by 
calling get or set methods."
- "The default attribute has no effect on the property and does not set an 
initial property value"
- "A direct assignment statement, such as myCFC.MyProp=27 creates a standard 
This scope variable in the CFC, even if you specify the property in a 
cfproperty tag. The This scope variable is independent of the properties that 
you access using the set and get methods. In fact, you can have a This scope 
variable with the same name as a property that you access using the set and get 
methods."

I wanted to mention those notes, just to clarify that (even in CF9) using 
cfproperty|property alone does not create an initial variable. In CF9, a 
private (variables-scope), not public (this-scope), variable can be created 
using the auto-generated setter (created by cfproperty|property, if 
accessors="true" on the component).

Thanks!,
-Aaron Neff

===========

> Hi All,
> 
> Can anyone please tell me the difference between cfproperty tag and 
> variables defined using this scope. Both are used to define CFC 
> properties? 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330397
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to