Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4486 + 2220 = 6706
Home Page
Data Communications and Networks I 4003-420-01/4005-740-01 Fall Quarter 2012
Course Page

4003-420-01/4005-740-01
Data Communications and Networks I
Programming Project 1

Prof. Alan Kaminsky -- Fall Quarter 2012
Rochester Institute of Technology -- Department of Computer Science

Introduction
ChemInfo App
Network Application Protocol
Software Requirements
Instructor's Server Program
Submission Requirements
Grading
Late Submissions
Plagiarism
Resubmission


Introduction

You will write the client program for a client-server network application, the ChemInfo App. The application uses TCP at the transport layer. The application protocol uses a textual encoding as specified below.

I will write the server program for this project. I will test your project by running my server program and your client program and seeing whether they communicate successfully.


ChemInfo App

The ChemInfo App lets the user find out information about chemical elements: atomic number, element name, and element symbol. Because new chemical elements are being discovered all the time, the information is stored and updated on a server, and the client program queries the server rather than storing the information on the client. (At least, that's the story for this project.)

The client program has a GUI that looks like this:

The GUI has three noneditable fields for displaying the current element's atomic number, name, and symbol; an editable field for entering a search string; and three buttons labeled Next, Previous, and Go. (Note: Your client program's GUI doesn't have to look identical to the above, but it does have to include the same UI widgets.)

When the client starts, the display shows information for atomic number 1.

When the user clicks the Next button, the display shows information for the next higher atomic number; except if the highest atomic number had been displayed, the display shows information for atomic number 1.

When the user clicks the Previous button, the display shows information for the next lower atomic number; except if the atomic number 1 had been displayed, the display shows information for the highest atomic number.

When the user clicks the Go button, the display shows information for the element that matches the search string. The search string may be either an atomic number, an element name, or an element symbol. The search string must match the atomic number, name, or symbol exactly (no partial matching). However, the match is case-insensitive (it doesn't matter if letters are uppercase or lowercase). If there is no match for the search string, an error dialog pops up, and the information in the display does not change.

When the user types the Enter key in the search text box, it has the same effect as clicking the Go button.

When the user closes the window, the client program terminates.

All the atomic number, element name, and element symbol information comes from the server, both when the client starts and in response to UI actions. The client does not store any information about the elements.


Network Application Protocol

In the ChemInfo App, one instance of the server program is running and any number of instances of the client program may be running. Each client has its own session separate from those of all the other clients. The application uses TCP at the transport layer. The application protocol messages use a textual encoding.

When the client starts, it opens a socket connection to the server. When the client terminates, it closes the socket connection to the server.

When the Next button is clicked, the client sends a message over the socket consisting of a lowercase n character and a newline. (In Java, do this or the equivalent: println ("n").)

When the Previous button is clicked, the client sends a message over the socket consisting of a lowercase p character and a newline.

When the Go button is clicked, the client sends a message over the socket consisting of a lowercase g character, a space character, the search string, and a newline. For example:

g helium

If the server receives a message other than one of the above, the server ignores the message.

To specify the information to be displayed, the server sends a message over the socket consisting of a lowercase i character, a space character, the atomic number (a string), a space character, the element name (a string), a space character, the element symbol (a string), and a newline. For example:

i 2 Helium He

To report that there was no match for the search string, the server sends a message over the socket consisting of a lowercase n character and a newline.

If the client receives a message other than one of the above, the client ignores the message.


Software Requirements

    Client Program

  1. The client must be written in Java.

  2. The client's main class name must be ChemClient, and this class must not be in a package.

  3. The client must be run using the following command line:
    java ChemClient <host> <port>
    
    where <host> is the host name to which the server is listening for socket connections and <port> is the port number to which the server is listening for socket connections.

  4. The client must print an error message on the console and must terminate if there are any of the following problems with the command line arguments. The wording of the error message is up to you. The error message may include an exception stack trace.
    1. There are too few or too many arguments.
    2. The port number cannot be parsed as an integer.
    3. The client cannot set up a connection to the given host and port.

  5. The client must display a graphical user interface (GUI) as specified in ChemInfo App above. The layout of the GUI is up to you.

  6. The client must operate as specified in ChemInfo App above.

  7. The client must communicate with the server using the Network Application Protocol specified above.

  8. The client must continue running until the user closes the GUI window, then the client must terminate.

  9. If any error occurs while the client is communicating with the server, the client must close its socket connection, must print an error message on the console, and must terminate. The wording of the error message is up to you. The error message may include an exception stack trace.

  10. The client must not print anything on the console except as specified in the preceding requirements.


Instructor's Server Program

To help you develop the client program, you may download a JAR file containing the Java class files for my server program: arkserver.jar

To run my server program, type this command:

java -classpath arkserver.jar ChemServer <host> <port>
where <host> is the host name and <port> is the port number to which the server listens for socket connections.

You are not allowed to use the contents of my server JAR file in any way in your Programming Project 1 and Programming Project 2, other than to run my server program. See the Course Policies for my policy on plagiarism.


Submission Requirements

Your project submission will consist of a Java archive (JAR) file containing the Java source files for your client program.

See my Java source files which we studied in class for the style of Javadoc comments I'm looking for.

Put all the source files into a JAR file named "<username>.jar", replacing <username> with the user name from your Computer Science Department account. The command is:

jar cvf <username>.jar *.java

If your program uses classes or interfaces from the Computer Science Course Library without changes, then you do not need to include these classes' or interfaces' source files in your JAR file. If your program uses classes or interfaces from the Computer Science Course Library with changes, then you do need to include these classes' or interfaces' source files in your JAR file.

Send your JAR file to me by email at ark­@­cs.rit.edu. Include your full name and your computer account name in the email message, and include the JAR file as an attachment.

When I get your email message, I will extract the contents of your JAR file into a directory. However, I will not replace any of the source files in the Computer Science Course Library with your source files; your project must compile and run with your files in their own separate directory. (You can do this project without needing to replace any source files in the Computer Science Course Library.) I will set my Java class path to include the directory where I extracted your files and the directory where the Computer Science Course Library is installed. I will compile all the source files using the JDK 1.6 compiler. I will then send you a reply message acknowledging I received your project and stating whether I was able to compile all the source files. If you have not received a reply within one business day (i.e., not counting weekends), please contact me. Your project is not successfully submitted until I have sent you an acknowledgment stating I was able to compile all the source files.

The submission deadline is Monday, October 8, 2012 at 11:59pm. The date/time when your email message arrives in my inbox (not when you sent the message) will determine whether your project meets the deadline.

You may submit your project multiple times before the deadline. I will keep and grade only your most recent submission that arrived before the deadline. There is no penalty for multiple submissions.

If you submit your project before the deadline, but I do not accept it (e.g. I can't compile all the source files), and you cannot or do not submit your project again before the deadline, the project will be late (see Late Submissions below). I strongly advise you to submit the project several days before the deadline, so there will be time to deal with any problems that may arise in the submission process.


Grading

Your project will be graded as follows:

I will evaluate the design of your programs as documented in the Javadoc and as implemented in the source code. I will evaluate the design for factors including but not limited to the following: adherence to the Software Requirements; adherence to principles of good object oriented design; appropriate usage of network application design patterns studied in class, including but not limited to model-view-controller and server proxy.

Each portion of the design will be graded as follows:

I will run test cases on your project to determine whether the Software Requirements were correctly implemented. The test cases will use my server program and your client program. I may run the programs on the same computer or on separate computers. The Java classpath will include the following directories: the directory containing your client program, the directory containing my server program, and the Computer Science Course Library directory.

The test cases will be graded as follows:

If the client program cannot be run using the command line specified in the above Software Requirements, you will receive 0 points for the test cases portion of your grade, and I will not test your project further.

If there is any deviation from the requirements, no matter how small, you will receive 10 points for the test cases portion of your grade, and I will not test your project further. The requirements state exactly what the output is supposed to be, and there is no excuse for outputting anything different. If any requirement is unclear, please ask for clarification.

After grading your project I will put your grade and any comments I have in your encrypted grade file. For further information, see the Course Grading and Policies and the Encrypted Grades.


Late Submissions

If I have not received a successful submission of your project by the deadline, your project will be late and will receive a grade of 0. You may request an extension for the project. See the Course Policies for my policy on extensions.


Plagiarism

Programming Project 1 must be entirely your own individual work. Programming Project 1 is not to be done as a team effort. I will not tolerate plagiarism. If in my judgment the project is not entirely your own work, you will automatically receive, as a minimum, a grade of zero for the assignment. See the Course Policies for my policy on plagiarism.


Resubmission

If you so choose, you may submit a revised version of your project after you have received the grade for the original version. You are allowed to make one and only one resubmission of the project. However, if the original project was not successfully submitted by the (possibly extended) deadline or was not entirely your own work (i.e., plagiarized), you are not allowed to submit a revised version. Submit the revised version via email in the same way as the original version. I will accept a resubmission up until 11:59pm on Friday, November 9, 2012 (the last day of classes). I will grade the revised version using the same criteria as the original version, then I will subtract a number of points equal to 10% of the original total points as a resubmission penalty. The revised grade will replace the original grade, even if the revised grade is less than the original grade.

Data Communications and Networks I 4003-420-01/4005-740-01 Fall Quarter 2012
Course Page
Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4486 + 2220 = 6706
Home Page
Copyright © 2012 Alan Kaminsky. All rights reserved. Last updated 18-Sep-2012. Please send comments to ark­@­cs.rit.edu.