This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: JAXP Transformer contract
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] JAXP Transformer contract
- From: Johannes Döbler <jd at aztecrider dot com>
- Date: Sat, 12 May 2001 13:21:40 +0200
- References: <571B91EF5DD1D211A04900A0C9EAD2C8010FA6D1@coi01.coi.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
>Saxon comes with a SaxonServlet.java that demonstrates a caching pattern
>using a HashTable, and it seems to work well. Can someone email me
>off-list with the design pattern for "pooling" objects such as
>Transformer? I am assuming this means you have several Transformer
>objects available, to make up for the lack of thread safety... if you
>need one, it won't give you one unless it is believed to not be in use?
>
> - Mike
In database programming this pattern is known as ConnectionPool, but one
can easily extend ot to all kind of shared resources. Wikis Pattern
Repository's (http://c2.com/cgi/wiki?ConnectionPatterns) has some useful
material about it.
>Remarkably well considering how simplistic it is: it just accumulates
>compiled stylesheets in the "cache" until you clear them all out. None of
>those fancy LRU discard algorithms designed for poor souls with finite
>amounts of memory...
>
>Mike Kay
never heard of an unfinite amount of memory :-)
But the caching problem has a simpler solution: Just use a xslt
implementation with a threadsafe stylesheet object. (Of course TrAX does
not suppose thread safety - but that's just the mess with an API designed
after implementations were created).
Johannes
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list