QCXML Server

Nelson Mena

September 22, 2000

 

Development Plan

 

1) Define Server and Database Structure

Define server and database structures to be used by the XML files to represent both the server and databases.  Create DTDs for these structures.

 

2) Define RMI interfaces

Define RMI interfaces for the classes and methods that will be accessible remotely.  For example, the XMLServer interface may define the getDatabase() method, which would return an XMLDatabase object.  Only remotely accessible methods will be defined in these interfaces.  As of now, these interfaces are: XMLServer, XMLDatabase, XMLTable, XMLField, XMLRecord, XMLRecordset, and XMLSQL.

 

3) Implement Server Classes

Implement classes based on the appropriate RMI interface defined above; create empty stubs for the methods inherited from the RMI interfaces as well as for the local methods.  The implementations of the RMI interfaces will be named by appending “Imp” to the end of name of the interface from which it was derived.

Use Case: 1

Display Client Interface to Server

Goal: Provide an interface for the user interaction with the server.  This interface will allow the user to test server functions and behaviors when implemented. 

 

4) Server Connection

Code a main() function in the XML server implementation to start the server and bind it to the RMI registry.  At this point the XMLServerImp will be able to load the databases from permanent storage and create XMLDatabaseImp objects for each one of them.  Enable the “Server | Connect” menu option in the Client Interface to Server program, write supporting code for the menu option. 

Use Case: 2

Connecting to Server

Precondition: Server has been started; Client Interface has been started.

Goal: Allow users to connect to the desired server by providing the server name and port.  This is a primary function of the application.  This use case is expected to happen every time the Client Interface is started, or when user decides to access a different server.

 

5) Data Retrieval

Implement methods used to retrieve data classes, for example getDatabase(), getTable(), getField(), getRecord(), etc.  Each call to getDatabase() will return one of the XMLDatabaseImp objects already created on the server, while calls to getTable(), getRecord(), etc. will create a new XMLTable, or XMLRecord based on its XML representation obtained from the database.  Enable client interface menus for retrieving data, and write the appropriate supporting code.

Use Case: 3

Accessing Databases

Precondition:  The client should already be connected to a server

Goal: Allow users to connect to any database available in the connected server.  If successful, the user will be able to view a display of the database structure in the Client Interface program.  This case is expected to happen every time a user wants to access a database, either by refreshing the current database or by deciding to connect to another one.

Steps:  a) Access main database object

            b) Use main database object to retrieve all table objects

            c) Use each table object to retrieve its field and record objects

d) Display all obtained information in a hierarchical structure in the Client                Interface program

 

6) Data Storage

Implement methods used to modify the database, for example newField(), newRecord(), setValue(), etc.  Each of this methods will take care of ensuring no other call to itself has access to change the structure, or update data while it is doing so itself.  Enable Client Interface menus for updating the server.

Use Case: 4

Updating Database

Precondition: Exclusive access to structure or data being changed or deleted.

Goal: Allow user to make changes to the database structure (like table definitions, etc.) or data using the Client Interface program.  If the use case is successful the database will commit the changes to permanent storage, if not it will retain the previous values.

Steps:  a) Select data to change

            b) Set flag to indicate exclusive access to resource

            c) Make data changes

            d) Unset flag, indicating exclusive access is over

            c) Release resource if no longer needed.

 

7) SQL Querying

Implement XMLSQL to parse simple SQL statements, like SELECT and DELETE and return XMLRecordset if appropriate.  Integrate with the server either as a class with static methods, as a member of the XMLDatabase class, or both.

Use Case: 5

Querying the Database

Goal: Provide a simple way to retrieve data from different tables in the database that meet a specified condition (Query).  The user types a query in the Client Interface program, which is send to the server for processing, then it proceeds to display the data returned.