Database Reference
In-Depth Information
CHAPTER 16
Advanced Topics
This chapter introduces some of the more advanced things that can be done with
eXist, such as scheduled tasks, triggers, and internal modules. Many, although not all,
of the examples in this chapter are developed in Java as plug-ins to eXist. We do not
attempt to teach Java in any way in this chapter; rather, where the examples are in
Java, we have tried to make them simple, self-explanatory, and easily usable so that
even those without Java experience can learn from and make use of them. However,
some programming experience will undoubtedly assist you.
If you wish to extend and use additional external libraries for the
Java projects in this chapter whose code is deployed into
$EXIST_HOME/lib/user , be aware that if eXist also uses the same
libraries (consult the files in the subfolders of $EXIST_HOME/lib ),
you must ensure that you use exactly the same versions of the libra‐
ries as provided with eXist. To achieve this, you must set the cor‐
rect version on the dependency in your pom.xml file, and also set
the scope of the dependency to provided . This is required because
your Java code will be running in the same JVM as eXist and there‐
fore uses the same class loader; in this manner of operation, it is
only possible to have a single version of a specific class.
XQuery Testing
Creating tests to assert the correctness of your code and to prevent regressions in the
future can be desirable for many reasons. Over the last decade there has been a seri‐
ous focus within software engineering to provide better testing tools for program‐
mers. There have also been a number of testing philosophies and methodologies
developed, such as test-driven development (TDD) and behavior-driven develop‐
 
Search WWH ::




Custom Search