Online Grade Book ObjectStore Java Interface Project

OUTLINE

I.                    Abstract

II.                 Introduction

a.       Many web applications are supported by databases

b.      When the web application is built with an OO language like Java, it’s natural to store the site’s data in an OODB

c.       This paper describes how an ObjectStore database can be used to support a web site built with Java technology

III.               Description of the web application

a.       Student interface

                                                               i.      The Online Grade Book is a web application that students can use to check their course grades. The application first prompts the user to enter an ID, and then if the ID matches a record in the database, the grades for that student will be displayed on the web page.

b.      Teacher interface

                                                               i.      There is a second interface that is available only to the teacher, and it allows the teacher to view all the students’ grades, edit them, add new students, and change the percentage weights of the course elements.

IV.              High-level view of the application

a.       Two separate parts

                                                               i.      Access layer – There is an access layer that controls access to the database. This layer is a server class that listens for a request on a TCP/IP socket.

                                                             ii.      Web application – The web interface is provided by a JSP/servlet application. It uses a client class to connect to the server in the access layer and send it queries for the database.

b.      Screen shots showing the application

c.       Block diagram

d.      Classes for the objects stored in the database

                                                               i.      Persistence capable classes = If an object is to be stored in the database, then its class must be made persistence capable.

                                                             ii.      Person class

                                                            iii.      Weight class

                                                           iv.      Using the post processor to make the classes persistence capable

e.       Files used by this project

V.                 Creating the access layer

a.       ObjectStore basics

                                                               i.      Persistence capable classes and the post-processor

                                                             ii.      The database file

                                                            iii.      The database roots

                                                           iv.      Collection classes – Sun collections and ObjectStore collections

                                                             v.      Sessions

                                                           vi.      Transactions

b.      Step-by-step description

                                                               i.      DataManagerServer class – The DataManagerServer runs as an access layer that provides access to the ObjectStore database that holds the persistent Person and Weight objects. It is a server that listens on a TCP/IP socket for a connection request from a DataManagerClient object. When a request is received, a socket connection is opened and passed to a new DataManagerThread object which then handles the client’s messages.

                                                             ii.      DataManagerServerThread class – When it is instantiated, the DataManagerThread object first opens the database, and then it retrieves the roots for the two types of objects that are stored there, Person objects and Weight objects. After the database is opened, the thread waits for an incoming message containing one of the keywords, add, edit, remove, validate, validateadmin, weights, editweights, or exit.

c.       Key points

                                                               i.      Each DataManagerThread object opens a separate connection to the database

                                                             ii.      The valid operations are add, edit, remove, validate, validateadmin, weights, editweights, or exit

                                                            iii.      Each database accessing operation by the thread is executed in a transaction

                                                           iv.      The data returned to the client is not a persistent object for which a  transaction must be maintained

d.      Completed code

VI.              Creating the web application

a.       Step-by-step description

                                                               i.      The web application uses a Model-View-Controller architecture

                                                             ii.      The views are created by JSP files

                                                            iii.      The controller for the student interface is the Gradebook class. The controller for the teacher interface is the GradebookAdmin class.

                                                           iv.      The data is stored entirely within the ObjectStore database, and it is retrieved by the DataManagerClient class to connect with the DataManagerServer access class.

b.      Key points

c.       Completed code

VII.            Future directions

a.       Implement a web service that contacts the DataManagerServer in the access layer

b.      Implement an ASP .NET web application that uses the web service to retrieve data from the ObjectStore database

REFERENCES

Mansour Zand, Val Collins, Dale Caviness, “A Survey of Current Object-Oriented Databases,” Data Base Advances, Feb. 1995.

Charles Lamb, Gordon Landis, Jack Orenstein, Dan Weinreb, “The ObjectStore Database System,” Communications of the ACM, Oct. 1991.

 

 

 

Files

Filename

Purpose

AddStudent.jsp

Display a dialog to capture the data for adding a new student

AdminGradeReport.jsp

Display the grades of all students to an admin who has logged in successfully

CompareStudentIDs.java

Comparator class used by the TreeSet that stores Person objects that are returned by the DataManager. Keeps Persons in ascending order based on their user IDs.

DatabaseException.java

Exception thrown when there are problems with the database

DataManagerClient.java

Called by a Web application to invoke the DataManagerServer code that is the interface to the ObjectStore database called Gradebook.odb.

DataManagerServer.java

Provides access to the Person data and Weight data that is stored in the database. It is a server that listens for requests through a TCP port, and it services those requests by accessing the database.

EditStudent.jsp

Display a dialog to display the student's data and capture any changes to it

EditWeights.jsp

Display a dialog to edit the grade weights

GradeBook.css

Cascading style sheet

GradeBook.java

Controller servlet for the student interface of the Online Grade Book web application

GradeBookAdmin.java

Controller servlet for the teacher interface of the Online Grade Book web application

GradeBookAdminHeader.html

Header for Online Grade Book Administrator pages

GradeBookAdminLoginHeader.html

Header for Online Grade Book Administrator Login page

GradeBookGradesHeader.html

Header for Online Grade Book page showing the student grades

GradeBookHeader.html

Header for Online Grade Book pages

Login.jsp

Display the student login dialog and obtain a student ID from the user

LoginAdmin.jsp

Display the admin login dialog and obtain an admin ID and password from the user

Person.java

Persistent class for Person objects stored in the ObjectStore database; contains a person’s names, IDs, and grades

StudentGradeReport.jsp

Display the grades of a student who has logged in successfully

Weight.java

Persistent class for Weight objects stored in the ObjectStore database; contains the course ID and the percentage weights for each graded project and test

Weights.jsp

Display the course grade weights that are stored in the database