|
a wiser person than I in the office suggested that the creation of
the array of structs was a waste of processing and therefore
do the “singles” method, looped for each line
item entered in the form success = objOrder.AddNewDetail(form.qty, form.prodCode, form.refNum) //
run method many times loop many times the only downside I can think of is some of the logic for the updates
(a cheat that deletes all details and inserts fresh versions) moves from the CFC
to the calling CFM page – not a big deal, I suppose… if any one has 2c worth to add on this, please feel free… cheers barry.b From: Barry Beattie Hi all, just looking for ideas. I’ve got a master/detail order form that will
obviously be the presentation of an “order” CFC. It’s really
a performance/best practices Q on where to loop thru the details for the
inserts/updates. <psedocode type=”lazy”> // master part of the processing objOrder.CreateDate = form.CreateDate objOrder.DueDate = form.DueDate objOrder.Supplier = form.Supplier objOrder.customerID = form.customerID // etc… success = objOrder.AddNew() // what do people think I should do about the detail part
(order line items) for each line item entered in the form success
= objOrder.AddNewDetail(form.qty, form.prodCode, form.refNum) //
run method many times loop many times // OR ==================== arrDetail = new
array() for each line item entered in the form add
new array element add
new struct to array struct.qty
= form.qty struct.prodCode
= form.prodCode struct.refNum
= form.refNum loop many times success = objOrder.AddNewDetails(arrDetail) //run method once (unpacks the array of structs and inserts) any suggestions? thanx barry.b --- 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 |
