[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: JAXP Transformer contract
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? 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... 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|