CS 441 - Fall 2004

MP 2 - RMI

Due: Thursday, October 14, 2004 by 11:59 pm

For this assignment, you will use RMI to create a client/server program with two databases one for employees and one for projects.

The employee database is to have the following fields:

The project database is to have the following fields:

The Employee Name, Department, Project Name and Client fields can be stored as strings. The Start Date and Completion Date fields should be stored using the Java Date class. The Employee Number and Project Number fields can be stored as integers.

Your program should have two servers. One for the employee database and one for the project database. Each of these databases can simply be a List of records. Both databases are to be stored in a serialized file when the server program is not running. Each serialized file is to be stored in the same directory as its server. When each server starts its execution, it will read in the contents from the serialized file to initialize the database. If the serializable file does not exists, the server is to create the file and start with an empty database. The server is to write out to the serialized file anytime the contents of the database is changed. This will keep the serialized file in-sync with the database so the server will not need to write out the database when the server's execution is stopped.

Each of these databases will have its own client program to allow for the adding, modifying and deleting records to/from in the database. Below is a possible interface for the employee client. A similar interface can be used for the project client.i

A java program has been created to show a possible user interface in Mp2Gui.java.

Employee ID:


Employee Name:
Start Date:

The ID fields in both databases (the Employee Number and the Project Number) are to be assigned by your server program and not to be changed by client program. You can use any method you wish to make sure to make sure each Employee record has a unique Employee Number and each Project record has a unique Project Number (note: an Employee record can have the same ID field as a Project record). Perhaps the simpliest way to do this is to assign an ID value to be one greater than the largest ID value currently stored in the database when a new record is added to the database.

The Assignment Database

Your program is to have one additional client which is to maintain a cross-listing between the Employee and Project database. This will be called the Assignment database. This cross-listing is also to be stored in a serialized file that is to be stored in the same directory as the "assignment client". You are not required to create a server for the Assignment database. It can be maintained by the assignment client. The Assignment database is to have three fields:

The interface for the Assignment client could looks as follows:
Employee Number:
Project Number:

The Assignment Client will access the Employee Server and Project Server to get the information for the text area. The Assignment client will also validate the existance of the Employee and Project when a new record is added and when a List operation is performed. If a Employee or Project record does not exist, prompt the user to see if all records in the Assignment Database should be removed that contain the non-existance Employee or Project Number.

How to turn in your work

Your program is to be submitted electronically via the turnin command on the LINUX machines. The project name for this is mp2. All programs are expected to be written in good programming style using the java programming language.

Turnin your program electronically using the "turnin" command from your CS account as follows:

turnin -c cs441 -p mp2?[your project directory]
where the [your project directory] is the directory name under which you have all your files related to this programming problem. The turnin command will automatically compress the data under your directory, so there is no need to do the compression by yourself.

Notice you can only invoke turnin command on the Linux machines in the lab or after logging into the server machine oscar.cs.uic.edu.

If you want to verify that your project was turned in, look in the turnin directory for a file with your userid. For instance for this project, from your CS account you would type:

  ?turnin -c cs441 -v

Note that you can execute turnin as many times as you would like, up until the program deadline when turnin will be disabled for this project. Each time you execute turnin for a project, you overwrite all of what you had turned in previously for that project.It does not work in an incremental way.

Grading criteria

?Here is a grading criteria for this programming project, subject to some minor adjustment in the future.

1 If you finish your project, submit it on time and your java code can compile ( TA might try to recompile your source code on Linux machines in CS lab, so you had better try to compile and test your work in lab to avoid any potential incompatibility problem), you get 40 base points.

2 If you have the employee client for inputting records of employee, you get 10 more points.

3 If you have the project client for inputting records of projects, you get 10 more points.

4 If your employee and project RMI server can save data into serialized files using Java Serialization, 10 more points

5 If you program can assign unique IDs to newly added project and employee as required in the problem description, 5 more points.

6 If you have assignment client which implements the functions for add, delete, previous, next buttons, 10 more points.

7 If your assignment client implements "List projects for employee" and "List employees for project", 5 more points

8 Have good coding style and provide a understandable readme description file for the project, 5 more points. What you put in the readme file is an overview description of your program's internal structure, steps to compile and run your program. 

9 Don't have any other unexpected issues (5 points).