[xquery-talk] Extending Saxon (Barxon, Fooxon, ...).

Per Bothner per at bothner.com
Sat Mar 19 10:05:57 PST 2011


On 03/19/2011 03:15 AM, Adam Retter wrote:
> In eXist-db we are considering moving to a more flexible mechanism for
> describing and packaging extension functions. At present this
> information is held in String constants in Java files. We have
> considered an XML manifest which describes the module, namespaces and
> arity and type of parameters of extension functions within the module.

Instead of using a separate ExtensionFunctionDefinition class I would
consider using Java annotations.  That would allow a single file without
cluttering up the runtime JVM, using a compact and easily-readable and 
-writable
format.  One possible issue is that writing out annotations into class
files is non-trivial, but hopefully you're your either generating Java 
source
or using a classfile library that can deal with annotations.  (I recently
added annotations support to gnu.bytecode, used by Kawa/Qexo.)
-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/


More information about the talk mailing list