Rel359 icon

Rel359


A Relational Database Tool for M359 Students

Inside Rel359

Rel359 is based on Rel, however there is no published developer documentation for Rel, so this page gives a very brief overview of how a few parts of Rel359 are actually implemented. In developing Rel359 I did not need to change every part of Rel and so I didn't need to work out how it all worked! Many of these comments will also apply to Rel because the differences between Rel and Rel359 are actually very small.

Packages

Rel359 was written in Java 1.6 using Eclipse 3.4 and the full source code is included in the install for Rel359. The source code consists of four main packages and one test package:

  • Rel3Server – This is the main database engine. It accepts input from Rel3Client, processes the data and sends the results back to Rel3Client. Almost all the changes to Rel to create Rel359 were in this package.
  • Rel3Client – This package accepts user input from Rel3DBrowser, sends it to Rel3Server, accepts the results from Rel3Server and makes them available to Rel3DBrowser. In principal Rel3Client could be running on a different machine to Rel3Server.
  • Rel3DBrowser – This is the main user interface for Rel, it accepts user input sends it to Rel3Client and displays the results returned by Rel3Client.
  • Rel3Shared – This package contains parameters that are shared between Rel3Server and Rel3Client. In practice this is just the port used for communication.
  • Rel3Test – This package contains tests for various parts of Rel. I did not update this for Rel359 so some of the tests may fail.

In addition to the packages above, Rel359 requires the Sleepycat / Oracle BerkeleyDB library and JUnit. BerkeleyDB provides the actual storage functionality for Rel359 and the compiled version can be found as je.jar in the Rel program folder. JUnit provides test functionality for the Rel3Test package.

Dependencies

If you want to build Rel359 for yourself there are a number of dependencies between these packages which must be resolved before Rel359 will build:

  • Rel3Shared has no dependencies.
  • Rel3Server depends on R3Shared and the Sleepycat / Oracle BerkeleyDB library.
  • Rel3Client depends on Rel3Shared & Rel3Server.
  • Rel3DBrowser depends on Rel3Client & Rel3Server.
  • Rel3Test depends on R3Server and the JUnit library.

Language parser

Rel does not directly implement the Tutorial D language parser in hand written code, rather it uses JavaCC. This reads the grammar for a language and then generates a parser based on the rules of the supplied grammar. I used the same approach in Rel359 as it meant that in most cases I just needed to update the grammar and rebuild.

If you have extracted the source files to the default location, then this grammar file will be found at
    C:\Program Files\Rel359\Source\Rel359Source\Rel3Server\ca\mb\armchair\rel3\languages\tutoriald\TutorialD.jjt
Note that this file is still includes "tutoriald" in the path and file name although it has now been converted for the M359 Language. Tutorial D is referenced at many points in the code and I didn't have time to rename everything appropriately.

All the several hundred files in the
    C:\Program Files\Rel359\Source\Rel359Source\Rel3Server\ca\mb\armchair\rel3\languages\tutoriald\parser
folder are auto-generated by JavaCC and should not be modified manually.

page last updated: Thursday, December 31, 2015