Right... different beast. There are different approaches... I use the "this"
scope as read only... less cryptic, and if they ever add getter/setter
methods to CFCs... it will still be compatible with that protection scope if
and when they do. I do not use it to set values though.

John Farrar


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Dave Watts
Sent: Monday, November 15, 2004 8:57 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] concerning this / variables scope in cfc

> In certain languages, like VB6, you have property methods 
> (Get & Let). When you use: obj.firstName = "Mike", the Let 
> method is implicitely called.
> 
> To me, the "this" scope is the same thing, but in a different 
> language. I got away from using the "this" scope in favor of 
> setters and getters, but I probably only did that because of 
> other people's suggestions.
> 
> Would it make a difference if CF supported property methods 
> such as VB6? Would that make it "better" in other's minds?  
> Would it then be appropriate to use "this.firstName"?
> 
> Would anyone else want CF to support property methods?

The problem is that, while these things may seem the same they're really
not. Within VB, when you specify your property getters and setters, you can
control and limit access to properties as appropriate. The "This" scope
doesn't allow you to do this. If you could automatically map property names
to getter and setter methods, that might be nice but I suspect it would be
difficult to make that backward-compatible.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
[EMAIL PROTECTED]

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at 
[EMAIL PROTECTED]

Reply via email to