wouldn't it be nice if under the "variables" section of cfadmin we could
tick "employ fusebox attribute scoping" and have formurl2attributes replaced
by actual cfserver code which copied our form and url variables into the
genuine attributes scope.  Maybe even a new parameter for cfsetting which
allowed us to choose whether or not we wanted to preserve the original
scopes or not - that we we;d also deal with the overhead of duplicated
variables.

anyone with Allaire's ear care to mention it? <g>


Toby Tremayne
Code Poet and Zen Master of the Heavy Sleep
Show Ads Interactive
359 Plummer St
Port Melbourne
VIC 3207
P +61 3 9245 1247
F +61 3 9646 9814
ICQ UIN  13107913

-----Original Message-----
From: Erki Esken [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 24 March 2001 5:48 AM
To: Fusebox
Subject: Re: Musings on Attributes (was Best Practices...)


> 2. Formurl2attributes creates copies of form and url variables, thus
> doubling the server memory used for those scopes in Fusebox apps.
> I'd much rather see a means to use a structure of pointers that
> would cover form-, url-, and attributes-scoped variables. This
> would accomplish the same goals as using the current approach,
> while streamlining memory use and providing a complete structure
> for accessing variables "passed into" a Fusebox module.

Maybe a new function, lets say GetPointer(variable), should be implemented
in CF? CF handles pointers internally now anyway (when copying sturctures
that have structures inside like <cfset st2 = st1> them etc). So if there
was a special function that could get the pointer for simple variables
too, that would be the ultimate thing, right?

Then formURL2attributes could be something like this:

<cfif NOT StructIsEmpty(url)>
  <cfloop collection="#url#" item="urlname">
    <cfif NOT StructKeyExists(caller.attributes, urlname)>
      <cfset caller.attributes[urlname] = GetPointer(url[urlname])>
    </cfif>
  </cfloop>
</cfif>
<cfif NOT StructIsEmpty(form)>
  <cfloop collection="#form#" item="field">
    <cfif NOT StructKeyExists(caller.attributes, field)>
      <cfset caller.attributes[field] = GetPointer(form[field])>
    </cfif>
  </cfloop>
</cfif>

Erki
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to