Dave,

Another possibility:

Perhaps all of the instances of the persisted CFC merely carry a
name/pointer pair which points to a singe stale copy of the method and
hence Sean's statement still holds partially true regarding not taking
up a "great deal of space".

However, I'm merely making a similar conjecture.

André
-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: 27 May 2003 17:25
To: CF-Talk
Subject: RE: is an object with a lot of methods a memory buster?

> > However, I believe that when you create a CFC instance, 
> > you get (effectively) a Java Map (actually an implementation 
> > of a Map) that has entries for each method. Each entry is
> > merely a 'pointer' to the representation of the method. 
> > I'm guessing that based on the fact that you can access 
> > methods of a CFC instance as variables:
> >
> > fn.cfc:
> >     <cfcomponent>
> >             <cffunction name="foo">
> >             </cffunction>
> >     </cfcomponent>
> >
> > tfn.cfm:
> >     <cfscript>
> >             x = createObject("component","fn");
> >             y = x["foo"];
> >             y = x.foo;
> >     </cfscript>
> >
> > 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).
> 
> Good answer; that's just what I wanted to hear. Thanks very 
> much!

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.

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


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

Get the mailserver that powers this list at 
http://www.coolfusion.com

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

Reply via email to