Hi, Rick.

"Rick Bullotta" <[EMAIL PROTECTED]> wrote on 2004-12-28 
07:42:56 AM:
> Yes, I know this is a loaded question <g>, but we've found that factory
> models are often causing SIGNIFICANT performance hits on object 
creation,
> especially when the factory has to defer to looking for property files,
> getResourceAsStream(), and the classloader's handling of class.forName() 
and
> newInstance(), getResourceAsStream.
>
> We were also wondering why each package seems to have its own 
ObjectFactory
> implementation, with mostly the same code (and most of the code appears 
to
> be unused).

There was a time when the various packages in Xalan-J shared a common 
ObjectFactory class.  That presented a security exposure.  If Xalan-J is 
loaded by the boot-strap class loader (for instance, when it's packaged as 
part of J2SE 1.4.x and later versions), some of the methods in that old 
ObjectFactory implementation could be used to bypass a security manager. 
To close that exposure, the ObjectFactory has to be package protected, 
which means each package needs its own copy.

In order to simplify maintenance, we just copied ObjectFactory everywhere 
it was needed, regardless of whether all the methods in the class were 
needed by a particular package.

> As a specific optimization example, DTMManager uses
> ObjectFactory.createObject(), but when would anything other than
> DTMManagerDefault be used? 

In the case of XSLTC, I know of users who make use of a replacement DTM 
manager.  Note that XSLTC uses the factory mechanism to find its DTM 
Manager in a slightly different way than Xalan-J Interpretive.  The 
Interpretive processor uses the factory to find a DTMManager on each 
transformation; XSLTC looks up the class that implements its DTMManager 
only when a TransformerFactory instance is created, and uses that class 
for every transformation.  Perhaps we should follow that model everywhere 
in Xalan-J.

> Thus far, this is the only one we've found in Xalan that can be 
optimized.
> Setting system properties to pre-empt this searching has a 
***PROFOUND***
> positive effect on performance, but it isn't clear other than trial and
> error what/where all of the properties are located (in both Xalan and
> Xerces, for that matter).
> 
> Is there any documentation on the various factories and their defaults? 
The
> only one we could find that would actually defer to 

Good question.  I don't believe Xalan-J has such a consolidated list. I'll 
open a bug report in Jira to track this.

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to