I agree--that's the only thing that's really nice about having it. Again, I
just wonder if the cost is worth it.
Hal Helms
Team Allaire
[ See www.halhelms.com <http://www.halhelms.com> for info on training
classes ]
-----Original Message-----
From: Toby Tremayne [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 11:37 PM
To: Fusebox
Subject: RE: Musings on Attributes (was Best Practices...)
and just to add another three cents worth:
the other thing I think is an advantage is that if a fuse requres a
variable, then it doesn't have to know where that's coming from - url,form
or attributes. That means I can reuse a fuse/circuit, WITHOUT KNOWING the
code involved and without making changes, and it will still work.
Take the example of a simple search circuit.
use 1
we have dsp_searchForm.cfm which submits to the fusebox, passing
form.searchTerms, which we pass in to the search circuit.
use 2
we have dsp_showList.cfm which lists a bunch of texts, with a link next to
them offering the ability to "search for items like this". That would send
url.searchTerms to the search circuit.
So to accomodate these I either need conditional logic in my search circuit
or I make changes wherever necessary - both of which mean we're missing the
point as far as code reuse goes. Using attributes scope I don't have this
problem...
sorry, long winded but yeah. that's what I think
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: Jason Egan [mailto:[EMAIL PROTECTED]]
Sent: Friday, 23 March 2001 3:28 PM
To: Fusebox
Subject: RE: Musings on Attributes (was Best Practices...)
well, it is nice when you're doing straight FB, but as you start to
implement the XFB I can see where it would be more of a hindrance.
Jason Egan
-----Original Message-----
From: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 9:13 PM
To: Fusebox
Subject: RE: Musings on Attributes (was Best Pracices...)
Why have a separate scope at all? What's wrong with just using the URL and
form variables as is? That's what I haven't decided on--is having a single
scope worth the hassle?
Hal Helms
Team Allaire
[ See www.halhelms.com <http://www.halhelms.com> for info on training
classes ]
-----Original Message-----
From: Jeff Peters [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 11:03 PM
To: Fusebox
Subject: Musings on Attributes (was Best Pracices...)
Well, after a small bit of tinkering, here are some thoughts:
First, the processing overhead of FormURL2Attributes isn't huge at all. I
created a variable with 80,000 characters in it, and the difference between
processing the page with and without FormURL2Attributes was a grand 2ms.
OTOH, there is the issue of memory on the server, and doing little
experiments
like this does tend to clog that bottleneck. So, I tried this little gem:
------------------- Vars2FBVars.cfm ----------------------
<cfset FBVars = form>
<cfloop collection="#url#" item="var">
<cfset foo = StructInsert(FBVars,var,Evaluate('url.' & var))>
</cfloop>
---------------- End Vars2FBVars.cfm ---------------------
Those who have been bitten by it will remember what happens when you assign
a
variable the contents of a structure, as in line 1: you get pointers
instead
of a copy of the data. It's irritating if you don't want it to happen, but
perfect for what we want here: to change the referent structure without the
overhead of copying the data.
Unfortunately, there's no way (that I've found yet anyway) to make pointers
for
two structures and combine the two structures into one, so we have to make a
copy of the url structure's pairs into the FBVars structure, as in the loop.
This is an acceptable compromise due to the limited nature of a URL--you'll
never get 80,000-character values in there, now will you?
So we end up with a structure, FBVars, that does what Hal wants (combines
all
the url and form variables in a single structure which you can loop over,
and
isn't a fake copy of the attributes scope). The only question left in my
mind
is whether it's worth bringing in genuine attribute-scoped variables as
well.
The only case where you would need this is if you were going to call the app
as
a custom tag, and I think we're finding that case to be quite uncommon.
Thoughts? What say you, Hal?
- Jeff
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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