Hi Jamie You mention the key values are stored in a structure in the application scope ? Is this because they do not change very often? If this is the case, could you generate all the <SELECT> list tags once (or on-demand) and cache them as elements in an (application-scope) structure and simply display them rather than dynamically building each required selector each time?
Just an idea Aaron ----- Original Message ----- From: "Jamie Lawrence Jenner" <[EMAIL PROTECTED]> To: "CFAussie Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, May 13, 2004 2:56 AM Subject: [cfaussie] structure versus QoQ > Hello, > > i have a retail site. Each product can have any combination of selectors > which the retailer simply ticks when adding the product to his db. The > selectors required are then stored as a comma delimited list (eg mens > size, quantity). When outputted, the list is looped over, and finds the > relevant key values stored in a structure in the application scope. > > mens size : 30,32,34 > quantity: 1,2,3,4,5 > > The structures values are then looped over and outputted as selectors > > <cfoutput> > <cfloop list="#selectorneeded#" index="i"> > <cfset opval = #StructFind(application,"#i#")#> > <cfset selname = "opt_" & #i#> > #i# > <select name="#selname#" class="styles" required="yes"> > <option value="--" selected>--</option> > <cfloop list="#opval#" index="val"> > <option value="#val#">#val#</option> > </cfloop> > </select><br> > </cfloop> > </cfoutput> > > > > This works fine and has no problems. However, i suppose i could do the > same using QoQ. > > Cache the orginal query which creates the selectors structure (the > structure is an exact copy of the table anyway) > > Then on output, use QoQ to query the cached query and retrieve the > relevant selector and values required. > > Does this seem feasible? My inkling is toward the QoQ method. Its > certainly easier to code! > > Does this method improve performance? Are more resources used looping over > structures then query objects? > > Shall i use the QoQ method? > > Just after another view on the matter before i go and hack my code to > pieces! > > cheers > > Jamo > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia > http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
