W3C home > Mailing lists > Public > xproc-dev@w3.org > October 2009

Calabash: main driver extensibility

From: Florent Georges <fgeorges@fgeorges.org>
Date: Sun, 11 Oct 2009 22:49:26 +0200
Message-ID: <ebaca5bf0910111349v35a0183fg5f9ace50a043f9a0@mail.gmail.com>
To: XProc Dev <xproc-dev@w3.org>
  Hi,

  It seems the main Calabash's driver for the command line suffers
the same problem than Saxon's drivers: it is not really extensible
through derivation, because the whole processing is done in one
single, monolithic method.

  It would be nice to have Main.run() cut down into smaller
pieces, so one could extend the class and plug his own processing
by overriding the existing methods.  At very least, it would be
nice to be able to deal with the XProcRuntime object right after
its creation.  Something like replacing the following line at the
middle of the file:

    runtime = new XProcRuntime(config);

by:

    runtime = makeRuntime(config);

and adding the following protected method:

    /**
     * Create a new runtime object from a configuration object.
     *
     * Override this method if you want to set the runtime object up
     * in any particular way.
     */
    protected XProcRuntime makeRuntime(XProcConfiguration conf)
            throws XProcException
    {
        return new XProcRuntime(conf);
    }

  Regards,

-- 
Florent Georges
http://www.fgeorges.org/
Received on Sunday, 11 October 2009 20:50:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 11 October 2009 20:50:01 GMT