----- Original Message -----
From: "Matt Woodward" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 15, 2004 2:48 PM
Subject: Re: CFC help

> One thing to bear in mind--if you're using cfinvoke, unless you're
> calling it against an object that's already been created, cfinovke
> creates the object, calls the method, and then destroys the object, so
> if you're going to call more than one method on an object you aren't
> going to want to do that using cfinvoke.  You're better off creating
> the object using cfobject or CreateObject() and then calling the
> methods against the instance of the object.
>
> Matt
 
Yep. However, even if you only need to create the object once, since CF uses automatic memory handling. This is  Automatic Memory Footprint Reduction (unlike C++ or other object oriented languages). CFINVOKE simply is a wrapper for what you can do in cfscript. When using CreateObject(), the object and the data that belongs to them are automatically handed back to the heap when the data is handed back to the client browser unless the method or the data the method invokes are placed into shared scope var like application, session or server. The CFMX garbage collector then comes around and hands it back to the OS. Also, keep in mind that even if you cached the entire method forever, we are only talking about a K. You could literally get thousands of methods in a few MB.
 
Regards,
 
Phillip B. Holmes
 
 

Reply via email to