DGBMS DESIGN SPECIFICATION

Table of contents

0.- Abstract	1

1.- Extensions	1

1.1.- Data access	1

1.2.- Functions	1

1.3.- Data types	2

1.4.- Queries	2

2.- DataSource management	2

2.1.- Data source type	2

2.2.- DataSource abstraction	2

2.3.- Indexes	2

2.4.- DataSource creation	2

2.5.- Data access types	2

2.6.- DataSource capabilities	2

2.7.- DataSource persistence	2

3.- Queries	3

4.- Modules	3

0.- Abstract

The main libraries used by gdbms are javacc to parse the instruction in a sintactic tree and the DriverManager to load the drivers

1.- Extensions

1.1.- Data access

gdbms provides the DataSourceFactory class to instantiate DataSources. The data source must be registered by name before we can instantiate a DataSource object. In the registration a name is associated with the source information: file name if the data source is a file, ... host, user, ... if the source is a database table. There are available three driver interfaces, one to access files, another to access databases and other to access objects. There is a decorator layer over the drivers in order to get a DataSource from a driver interface.

The database driver interface (DBDriver) is JDBC based and his only purpose is to provide to the overlaying layer a JDBC Resultset. The JDBC driver must be in the classpath in order to run gdbms successfully.

TODO: a layer diagram

1.2.- Functions

There is a FunctionManager class which roles as a registry in which the user can register the functions availables to the queries execution.

1.3.- Data types

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

1.4.- Queries

By implementing the CustomQuery interface it's possible to define a custom query. The way custom queries are added to the system is similar to the functions: there is a QueryManager class which manages the custom queries registration.

2.- DataSource management

2.1.- Data source type

TODO Driver class diagram explained

TODO architecture chart with all layers: driver, datasource, operation

2.2.- DataSource abstraction

TODO DataSource class diagram explained

2.3.- Indexes

TODO Indexes class diagram

2.4.- DataSource creation

TODO creation oriented class diagram showing the OperationDataSource as a third layer over the DataSource layer

2.5.- Data access types

TODO access oriented class diagram

2.6.- DataSource capabilities

TODO field access by name class diagram

2.7.- DataSource persistence

Each DataSource implementation will provide a DataSourceMemento derived instance with the persistence information. Such a object will be a javabean with the info needed to create the new DataSource. To get a DataSource from a memento the DataSourceFactory will instantiate a new object of the DataSource class specified by the memento and will reexecute the operation that originates the DataSource if it's a OperationDataSource and will access the gdbms table if it's a DataSource from the data source layer.

2.8.- Opening and closing DataSources

The opening and closing mode is implemented by adding a mode parameter to all public methods in the data source factory returning a DataSource.

2.9.- Exception handling

The internal exception handling is implemented by the observer design pattern in the com.hardcode.gdbms.engine.internalExceptions.InternalExceptionCatcher singleton class.

3.- Queries

The queries are processed by the system by the following sequence:

Parsing. The javacc compiler generator is used in order to parse the instruction. By parsing the instruction, a parse tree is obtained.

Adaptation. After the parse tree is obtained, an adapted tree is obtained whose nodes provide hish level information to the execution of the query.

Tree simplification. In this step, the useless nodes are removed from the tree in order to accelerate the query execution.

Source checking. The data sources involved in the query are checked to find if the query can be executed on the source server.

Execution. If the previous check do not success the instructión is executed by the gdbms.

4.- Modules

There is a QueryManager class which roles as a registry in which the user can register the custom queries.

2005-03-31T16:47:20