[xquery-talk] xquery library design

James Fuller james.fuller.2007 at gmail.com
Tue Dec 27 23:59:15 PST 2011


On Wed, Dec 28, 2011 at 12:13 AM, Jakob Fix <jakob.fix at gmail.com> wrote:
> so, would it be advisable to have this (where only application.xqy has
> all information necessary, but minimal inclusion takes place)
>
> - application.xqy that includes
>  - configuration.xqy
>  - library1.xqy
>  - library2.xqy
>  - lowlevelfunctions.xqy
>
> or rather this (where each library module is independent as it
> includes what's needed)
>
> - application.xqy that includes
>  - library1.xqy which includes
>    - configuration.xqy
>    - lowlevelfunctions.xqy
>  - library2.xqy which includes
>    - configuration.xqy
>    - lowlevelfunctions.xqy
>
> or still another scenario?
>
> sorry if that sounds confusing,

no not at all ...

a few things;

I would advise using an application level configuration library that
is global to your application as a starting point.

from there, depending on how you want to encapsulate your libraries,
you could take advantage of ML support for private annotations

http://docs.marklogic.com/5.0doc/docapp.xqy#display.xqy?fname=http://pubs/5.0doc/xml/xquery/enhanced.xml%2376225

which you can use to indicate where you would not want certain
variables to be protected from changing as author intention.

If you are to create standalone libraries then I would suggest that
you try to keep the imports to a minimum, pref to 1 so I would stump
up for placing variables within the library module themselves and
declare those which I would like to redefine by marking them external.

hth, Jim Fuller



More information about the talk mailing list