Sean

I think what Dave was talking about is actually changing the source code of
the CFC file.

--------------
Ian Skinner
Web Programmer
BloodSource
Sacramento, CA


-----Original Message-----
From: Sean A Corfield [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:40 AM
To: CF-Talk
Subject: Re: is an object with a lot of methods a memory buster?


On Tuesday, May 27, 2003, at 09:24 US/Pacific, Dave Watts wrote:
>>> So, in each CFC instance you create, you will get entries
>>> in the Map for every method (or, at least, every public
>>> method) but those entries won't take up a great deal of
>>> space (since they are just "name, pointer" pairs).
> While that may be what you wanted to hear, I have my doubts about it. 
> When
> you create an instance from a CFC and put it in a persistent scope, 
> then
> change one of the methods within the CFC code, the instance doesn't 
> use the
> new code, but rather the original code that was there when it was
> instantiated. This leads me to believe that it carries its own copy of 
> the
> method code with it.

Could you show an example of how you "change one of the methods within 
the CFC code" to get the effect you claim?

count.cfc:
        <cfcomponent>
                <cffunction name="one" returntype="string">
                        <cfreturn "one">
                </cffunction>
                <cffunction name="two" returntype="string">
                        <cfreturn "two">
                </cffunction>
                <cffunction name="get" returntype="string">
                        <cfreturn "get">
                </cffunction>
        </cfcomponent>

count.cfm:
        <cfoutput>
        <cfset session.count = createObject("component","count")>
        #session.count.one()# #session.count.two()# #session.count.get()#<br
/>
        <cfset session.count.get = session.count.one>
        #session.count.one()# #session.count.two()# #session.count.get()#<br
/>
        <cfset session.count.get = session.count.two>
        #session.count.one()# #session.count.two()# #session.count.get()#<br
/>
        </cfoutput>

Produces:

one two get
one two one
one two two

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

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

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

Reply via email to