Using multiple instances of Saxon processors

Hi,

In the architecture of XML Calabash V2, there's a different API.
There's an XProcEngine (name's kind of awful but whatever) that
contains the Saxon processor and other "global" configuration data.
You obtain a pipeline compiler and runtime from the engine.

I am sorely tempted to make the engine a singleton. The only drawback
that I can see is that it wouldn't then be possible to write a program
that ran multiple pipelines with different Saxon configurations (Saxon
HE and EE, for example) or with different implementations of the same
step.

The advantage is API simplification. Everywhere that the Saxon
processor or some other bit of global configuration is needed, it has
to be passed around either as part of the constructor for an object or
as a parameter to static methods because there's no way other way to
get at it. With a singleton engine object, it would always be
available.

Most users would never notice, but I know some folks have used the XML
Calabash APIs to build larger systems.

Anyone feel like pushing back on the singleton idea?

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
Lead Engineer
MarkLogic Corporation
Phone: +1 512 761 6676
www.marklogic.com

Received on Saturday, 14 December 2013 16:12:30 UTC