On Tuesday, May 27, 2003, at 16:20 US/Pacific, Shawn Grover wrote:
> We're declaring a Clear function which initializes the THIS properties 
> to a
> valid, known state.  Our procedure is to ensure the clear function 
> matches
> the CFPROPERTY declarations, and we call the Clear function when the 
> CFC is
> initialized.

And what's to stop some arbitrary method just setting this.foo to some 
value? (or, worse, some client code that instantiates a CFC and then 
sets the public data)

foo.cfc:
        <cfcomponent>
                <cfproperty name="bar" type="numeric"/>
                <cffunction name="clear">
                        <cfset this.bar = 0/>
                </cffunction>
                ...
        </cfcomponent>

bogus.cfm:
        <cfset foo = createObject("component","foo")/>
        <cfset foo.clear()/>
        <cfset foo.bar = "Hah! I'm a STRING now!"/>

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to