You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by "Karr, David" <Da...@wamu.net> on 2003/08/29 16:53:03 UTC

Caching Templates object instead of Transformer object

In superficial examples of using Transformers, it appears that it's safe
to cache Transformer objects for reuse.  However, in recent reading,
I've seen references to using the Templates object instead (isn't that
an odd class name?).  Apparently the Transformer instances created
directly by the TransformerFactory are not thread-safe, but the
Transformer instances created by the Templates object are.  Is this
correct?  How is this thread-safety ensured?  I would have guessed that
there would be different subclasses of "Transformer" being used, but I
don't see that happening.