Title: Message
Hi There,
 
I know it's a best practice to not use "evaluate" (for performance purposes) so was wondering if anyone had any ideas on removing it from this situation.
 
- I have a set of page objects in application scope with various properties and methods. 
- Each page object is named application.page.#pagename#
- I lazy load the pages, so on each page request, if not isdefined("application.page.#pagename#"), I initialize application.page.#pagename#
- I then set this page to the value of the appropriate page so I can access all of the page properties and methods easily.
 
I use the following code within a cfc:
  <cfset THIS.page = Evaluate("Application.page.#pagename#")>
Is there a better way to set THIS.page as a pointer to the right object(Application.page.#pagename#) without using evaluate? (Please note, I'm not trying to invoke/instantiate the object as it already exists - I'm only to set a pointer to it).
 
My code works, but I believe evaluate() is a slow operation and according to the CFMX coding guidelines there is almost always supposed to be a different way to get the same outcome.

Any thoughts appreciated!
 
Best Wishes,
Peter
 
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org

Reply via email to