the whole "this" episode is partly caused by the useless CFPROPERTY
(except for WS's, admittedly)

this is what I thought CFPROPERTY should really be...

<hypothetical type="wishlist">

<cfcomponent>
<cfproperty name="variables._length" type="numeric">
        <cfpropertyaction type="get">
                <cfreturn variables._length />
        </cfpropertyaction>

        <cfpropertyaction type="set">
                <cfargument name="length" type="numeric" required="yes"
/>
                <cfset variables._length = arguments.length />
        </cfpropertyaction>
</cfproperty>

<cfproperty name="variables._width" type="numeric">
        <cfpropertyaction type="get">
                <cfreturn variables._width />
        </cfpropertyaction>

        <cfpropertyaction type="set">
                <cfargument name="width" type="numeric" required="yes"
/>
                <cfset variables._width = arguments.width />
        </cfpropertyaction>
</cfproperty>
...{more code}...
</cfcomponent>

so you can go

(calling page)

<cfscript>
 myObj.length = 50;
 if (myObj.width GT 100){
        myObj.width = 100;
}
 myObj.update();
</cfscript>

</hypothetical>

now, if you ignore the lack of data validation that the THIS scope can
provide, you can do this right now with the THIS scope.

but as SeanC, ScottB, Spike, et al have said, the "THIS" public scope is
bad (mostly for type checking/validation reasons)

BUT... how CAN you have properties in CF that works as easily as, say,
VB's properties? without resorting to passing a million arguments to
methods (eg in the update() method above)?

where are the real setters and getters? why is CFPROPERTY so useless?

 
my Friday 2c worth
barry.b









---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to