From: Keats <ke...@xa...> - 2004-03-29 15:44:32
|
There probably should be a more straightforward way to get at the FastWriter than what I outlined, but I have a hard time thinking of a good use-case to justify this. Dumping a megabyte of dynamic text into a Web page seems a bit extreme. WebMacro was designed to cache all output before writing it out. If this isn't appropriate for a particular application, maybe WM isn't the right tool for that application. However, having said this, I'm all in favor of making the system flexible. You could, of course, implement your own subclass of FastWriter that doesn't cache and put a reference to that into the context. Something like a FastWriterOutputStreamAdapter. Maybe we should provide something like this with an UnbufferedWMServlet example. Keats ----- Original Message ----- From: "Endre Stølsvik" <Web...@St...> To: "Keats" <ke...@ea...> Cc: <la...@op...>; "Tim Joyce" <ti...@ho...>; <web...@li...> Sent: Saturday, March 27, 2004 10:41 PM Subject: Re: [Webmacro-devel] Re: [Melati-developers] WebMacro Test Case: TestSharedOutputStream > On Mon, 15 Mar 2004, Keats wrote: > > | I think Lane's solution is ultimately best -- don't try to write to the > | underlying stream from within a template, just return a String and let WM > | handle it. > > (Note: I have no good suggestions here, just a point.) > > This is bad for performance, I kinda feel. Returning a megabyte String to > be included in a stream, when you really could have outputted the stuff > you were making directly to the stream is really really not good. There > are probably a StringBuffer creation, several String creations, and > whatnot, in addition to the rush of memory being used for this TOTALLY > useless intermediate object. > > Allthough I hate the FastWriter, it -must- be possible for things inside > the template to directly output (read: "render") to the "actual target". > > That said, I come to think about the Macro interface (class?). Why does it > have two methods there? I have never understood which of the methods are > invoked when: one fo them (I am on vacation now, so I can't find the > details) have never been invoked when I have made Macro implementation. > This is also very very badly documented, not explaining nothing. > > Endre. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > |