DGBMS REQUIREMENTS SPECIFICATION

Table of contents

0.- Abstract	1

1.- Extensions	1

1.1.- Data access	1

1.2.- Functions	1

1.3.- Datatype	2

1.4.- Queries	2

1.5.- SQL Syntax extensions	2

2.- Data source management.	2

2.1.- Kinds of Data source	2

2.2.- DataSource asbtraction	3

2.3.- Indexes	3

2.4.- DataSource creation	3

2.5.- Data acces type	3

2.6.- DataSource capabilities	3

2.7.- DataSource persistence	3

3.- Queries	3

4.- Modules	3

0.- Abstract

GDBMS is a library that allows to make queries to data sets hosted in different formats and hosts. It follows the SQL92 syntax and extends it in several poins. Allows extensions to data sets types, queries, functions and data types.

1.- Extensions

1.1.- Data access

GDBMS is a driver driven database querier. The driver layer is the responsible to read and suply data to the overlaying layer.

The overlaying layer is the datasource layer and it's necessary to give all kind of data the same interface.

1.2.- Functions

You can develop any function by implementing the Function interface in which you implement the functionality of the function. The way to register a function is by the use of a function manager that stores the function implementations. That function implementation provides the name of the function that will be used in the queries.

1.3.- Datatype

All drivers can return any object provided it implement the Value interface so you can use any data type.

1.4.- Queries

It is possible to add a custom query to the system by implementing the CustomQuery interface. That implementation provides the function implementation and the query name. Gdbms extends the SQL standard to allow the execution of the custom query. The custom query syntax takes a query name, a table list and some expressions as input:

CUSTOM <ID> TABLES <FROM> VALUES ( <SumExpr>,* );

One example of such a query would be:

CUSTOM ARCJOIN TABLES vias, provin VALUES cod_prov, cod_prov

Where the meaning of each value or table is defined by the concrete implementation of the query. In the example above, the tables would be those we want to join and the values will be the name of each table's field used to join the tables.

1.5.- SQL Syntax extensions

In order to allow the previous extensions, the SQL syntax the gdbms accepts it's not standard. The main diferences are:

The custom query.

Function as any string. This string will be used to find the concrete implementation with the function code.

Table references as string literals. Since you can register a data source by string you must be able to refer that source in a SQL. If the source name contains spaces o any SQL id not allowed character it's possible to refer to the source with cuotes ('table name').

2.- Data source management.

2.1.- Kinds of Data source

gdbms is able to read data from files, from remote databases and from generic objects. It's possible to register a data source by name to use it in the sql queries. Such name can be changed at any time, but the brevious sql queries referrencing the previous name will result in a NoSuchTableException. It's possible to register a file, an object instance, a remote database table and a query on a remote database. The last data source type requires to define a view on the underlaying database management system so it's necessary to shutdown the gdbms properly to delete the created views. Views are created at the time the data source is registered in the gdbms and are removed when the data source is removed or the gdbms is shuted down. The DataSourceFactory provides a way to retrieve only some fields or some rows specifying a where condition.

2.2.- DataSource asbtraction

gdbms provides the DataSource common interface to all kind of data source types. With this abstraction it is possible to operate on a DataSource without knowing the concrete data source type that provides the data.

2.3.- Indexes

gdbms provides a disk storage hashtable implementation. The Value interface must explicitly define the equals and hashCode java.lang.Object methods in order to the hashtable to work properly. This index makes faster the queries where there is a 'equal' expression in the where clause.

2.4.- DataSource creation

It's possible to create a DataSource by the name used at registration and by a sql query where the table references are the names of the data source registration.

2.5.- Data acces type

There are two kinds of access to the records in a DataSource: random and sequential. If a DataSource can be accesed randomly its possible to access it sequentially but a sequential DataSource may not be accessed in a random way. If a query needs to access a DataSource randomly but those involved in the operation are sequential, the executing method must raise a well known runtime exception.

2.6.- DataSource capabilities

DataSources are able to provide the information the underlaying driver layer provides, whatever the source type is. It's provides the capability of accessing fields by name. The DataSource provides a memento object usefull to store the DataSource in a persistent media. There is a factory method to create the DataSource again from the memento object.

2.7.- DataSource persistence

DataSources must provide a way to store and retrieve themselves from and to a stream.

2.8.- Opening and closing DataSources

There are two opening and closing operation modes: automatic and manual. By the manual mode you have to explicitly open the data source before any operation. In the automatic mode, the DataSource opens and closes itself after a while of inactivity. The manual mode will be the default and the timeout for automatic mode will be configurable. There will be no time overhead in the manual mode. In automatic mode, all explicit calls to open or close the datasource will be ignored.

2.9.- Exception handling

As well as the throws clauses of every method, there are a number of exceptions that cannot be caught by the client code. The exceptions raised at internal threads must be caught by listening the exceptions as events in a static class following the singleton pattern. All exceptions raised in such parts of code are notified to the singleton ir order to allow the exception listeners to realize what had happened.

3.- Queries

gdbms is able to execute every query that conforms to the modified SQL grammar used.

4.- Modules

A module in GDBMS is only an object registered with a name in the core system which can be accessed from any part of the system. For example, there is a module to create geometry data types from the drivers. Such module suplies a geometry factory to the drivers but this factory can be changed to produce different geometries. With the module concept its possible to reach this functionality by changing the factory everywhere and accessing the factory from the drivers.

2005-03-31T08:13:58