The Book package provides an interface to a real store of data.
Different sources of data interact with the rest of the code via a
Book
interface. An implementation of Book
is
expected to be able to retrieve Biblical text for a given
Passage
, and to return a Passage
of verses that
contain a word.
A Bible is a specialization of a Book that uses Passages as basic data types.
The folowing is out of date since the Version -> Book/Bible split
There are several specializations of the Book
interface.
A MutableBook
is-a Book
that can be changed
either to accomodate Verse based notes or for a normal Book
that can be created at run-time. The latter option allows this system to
be installed on a computer that already has OLB installed without
requiring a download of the complete Bible source, but the source is
created either as part of the install or on the fly, and cached here.
Secondly a Translation
is a Book
that
understands Strongs numbering and can give information about how words are
translated to and from the original.
Currently there are 2 basic implementations of the Book
interface - an ODBCBook
and a FileBook
. The
former acts on an Access database via JBDC and ODBC. The latter on an
experimental serialized data store. Probably neither of these
implementations are of any long term use, however they do help get me up
to speed quickly.
I invisage at least 2 more production stores - an
OLBBook
that reads directly from OLB files exactly as
installed on Windows. (Maybe in reality there needs to be an
OLB7Book
and an OLB8Book
or something)
and a RemoteBook
that uses RMI / CORBA / HTTP or whatever
to retrieve the data from a remote server)
It is important that multiple data sources are available, to allow a compact download time. In an ideal world the base download, would be small enough to place as an applet on a web page, with some kind of "Save as application functionality" that still uses a remote data server. A cacheing Book could then store verses locally, only using the network for verses not retrieved yet.
The Biblical text is returned to the application as an XML document.
Allowing Book
s to contain data like red-letter markup
that a display module may not want to use. See the display section for
more details.
More work is needed here to with Strongs numbers and non-Biblical text sources. (Lexicons and such like)