[CJ] : your suggestion is very interresting, that's why I
love forums, you can pass 3 days looking for a solution and someone
totaly outside of the project finds a solution in a few minutes !
... too bad in the case I have, it's not possible as the
instancied object varies. I have a "product" abstract object which
is overridden by some "book", "software", ... objects. As I have
betwen 10 and 20 different "flavours" of objects, even if I can
instanciate them just one time (which is better than on each row),
I will still have 10 to 20 x 16ms per page... which is still slow.
I'm working on a caching mechanism to store the objects in
the Application scope, it looks promising.
EDIT : Hum in fact CJ, I'm not sure of your solution... in my
case... in each loop I create the object, I set different
properties and then I add it in a struct. So at the end on the loop
I have a struct of differents obects (books, softwares, ...). If I
try your solution, at the end I have a struct of objects which all
refers to the same object, with same properties. I naively though
that a
<cfif isdefined("fresh_#product_type#") is false >
<cfset "fresh_#product_type#" =
CreateObject("component","composants.produits.#product_type#")>
</cfif>
followed by
<cfset my_product = evaluate("fresh_#product_type#")>
would duplicate the object, not create a reference to
it...