Hi folks,

Here's my attempt to get some consensus viz. moving forward on some kind of
grammar preparsing API.  By grammar preparsing API, all I mean is one
(parse|load)Grammar(...):  Grammar methods accepting an XMLInputSource and
probably a String corresponding to the URI of the kind of grammar to be
resolved.  Perhaps we'll want another one taking a  XMLGrammarDescription
as a parameter, perhaps not.

Here's the choices as I grasp them:

(a) Not have one.  Just provide such a method on one or more of our own
Configurations in the parsers package, or maybe static methods on the
various Grammar implementations, and tell the world to use that.

(b) Write a new interface, extending xni.parsers.XMLParserConfiguration, in
the xni.grammars package; adding this (parse|load)Grammar method to this
new interface.  Configurations interested in supporting preparsing of
grammars they understand can then implement this new interface--in addition
to whichever ones they already implement--for the grammars they understand.

(c) Add the method to the existing xni.grammars.Grammar interface.  This
would turn Grammar into a factory of instances of itself, but would at
least give a grammar-implementation-independent way of preparsing grammars.

(d)  Make a new interface in the xni.grammars package, perhaps called
XMLGrammarCache, whose sole function is grammar preparsing and which
extends nothing.

(e)  Add grammar preparsing onto XMLGrammarPool, under the assumption that
in any real-world case in option (d), the same object would serve both for
preparsing and storage.

Note we haven't addressed the question as to what the parseGrammar method
should do when presented with a grammar type it doesn't understand; my
thought would be to throw an XMLConfigurationException but Andy probably
has a different view.  :-)

My own preferences would be (b) then (e) then (d).  I don't like the other
two much at all.

Have I missed any options?  If not I'll keep track of any votes and let the
list know what's happened by end of week (or earlier if people stop
responding.  :-).

Cheers,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  [EMAIL PROTECTED]



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

Reply via email to