"Gary Bisaga" <[EMAIL PROTECTED]> writes:
> I don't know, but I have been wondering about the same issue. In particular:
> in our application the displayed web page is made up of nested "sections",
> each of which has its own template. Sort of like jetspeed does it, with the
> portlets, controls, and controllers.
>
> This means that there's an awful lot of string copying going on, as you
> collect the results from the innermost template, include that in the
> next-outer template, and so on. One specific thing I was wondering is
> whether there is any support for using a scatter/gather kind of operation in
> Velocity, where you have a structure like this:
>
> public class ScatterGatherObject {
> // Each one of the objects in this list can either be (a) a String or
> // (b) another ScatterGatherObject.
> ArrayList subObjects;
> public String toString () { ... }
> }
>
> Velocity could, at each template stage, produce one of these objects instead
> of a String. The values you put in the context could be either Strings or
> ScatterGatherObjects; in the latter case, the new ScatterGatherObject would
> simply get a reference to the old one. Finally, at the end of processing,
> the toString method would go depth-first through all the
> ScatterGatherObjects and concatenate all the Strings in one big
> StringBuffer. It seems to me that this could potentially eliminate a hugh
> amount of string copying.
>
> Any thoughts?
Velocity streams data directly using the Writer it was provided with.
One the AST is built, static content needs no further memory allocated
for it.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>