Title: Message
would this work?:
 
 <cfset THIS.page =Application.page[pagename])>
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Bell
Sent: Monday, 27 February 2006 12:35 p.m.
To: [email protected]
Subject: [CFCDev] Calling an object with a variablized name without using evaluate?

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 [email protected] 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/[email protected]

This e-mail message has been scanned by MailMarshal from Marshal Software, an email content filter.


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] 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/[email protected]

Reply via email to