A query object generator tool is used to generate interface definitions and
source code which implement a database query object. The tool allows a
client to construct a query object without being familiar with the
underlying database language and without being concerned with programming
details such as concurrency problems and connection management. The tool
consists of an internal state object which represents the query object,
including information which can be saved to reconstruct the query object
at a later date, and code generator objects which generate the code
required to implement the query object defined by the internal state
object. In a preferred embodiment, the code generator objects are arranged
in a hierarchy so that a generator object can be instantiated which
generator object is specific to the database to be accessed and the
language to which the implementation is targeted. An optional graphic user
interface (GUI) may also be provided to allow a user to interact with the
tool.