What is the difference between cfproperty tag defined variable and the variables scope variable in ColdFusion?
I have Java language experience, can you compare the ColdFusion cfproperty variable, variables scope variable to the Java instance variable and class variable?
greate thanks!
CFPROPERTY is only useful for providing metadata for a component. The only time I ever use them is when creating a component for a Web Service, when they're required.
Here's a TechNote which discusses CFPROPERTY a bit further: http://kb2.adobe.com/cps/191/tn_19169.html
The variables scope is "protected" and only available within the component. The "this" scope variables are public properties. And, of course, any variable declared with the "var" keyword is private to that method.
Here's some more on component scopes: http://www.hemtalreja.com/?p=94
Note: cfproperty tag does NOT defined variables.
However, it is helpful when you use CFC Explorer (browse to the CFC directly), so that you can see the properties of the CFC object.
FYI... cfproperty will be much more useful in CF9. See: ORM - Rethinking ColdFusion Database Integration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With