On Fri, Jul 6, 2012 at 4:18 PM, Jason King <[email protected]> wrote:
> Assuming the business logic is right, and everything works as I want > it to, does anybody see any red flags? CFINVOKE creates the component, calls the method, and then destroys the component. So while ultimately the compiler may be smart enough not to literally do this every time (I can't confirm that myself), strictly speaking in your code below you're creating an instance of that same component half a dozen times which is very inefficient. This is why I suggested that if this CFC has functions that are used over and over again you'd want to instantiate the component once when the application starts and call functions on the instantiated version. As I said in a previous email the only time I ever use CFINOVKE is when I need to call a function name that's a variable. Other than that, if you choose not to instantiate the component once on application start for whatever reason, you'd be better off (not to mention the code would be much more readable) if you instantiate the component once and then simply call methods on the instantiated component instead of calling CFINVOKE over and over. -- Matthew Woodward [email protected] http://blog.mattwoodward.com identi.ca / Twitter: @mpwoodward Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments. http://www.gnu.org/philosophy/no-word-attachments.html -- online documentation: http://openbd.org/manual/ http://groups.google.com/group/openbd?hl=en
