SDSU CS 580 Client-Server Programming
Fall Semester, 2002
Assignment 1
    Assignment Index        
© 2002, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 11-Sep-02

Assignment 1 – Faculty Information Client
Due Sept 26, 2002

The server. There is an xml-rpc server running on rugby.sdsu.edu that provides faculty office numbers and phone numbers.

The server url is http://rugby.sdsu.edu:8008/cs580

The server supports the following methods:

departments
Has no arguments. Returns a xml-rpc struct with two keys: name and id. The value at each key is an xml-rpc array. The array at the key name contains the names (a string) of departments like “Computer Science” and “Mathemetics & Statisitics”. These names are suitable for displaying to a user. The array at the key id contains an id (a string) for the department. The k’th element in the id array corresponds to the k’th element in the name array. The ids are to be used as arguments to the facutlyIn method below.

facultyIn
Has one argument a string. This string is an id for a department that is obtained from the departments method above. FacultyIn returns and xml-rpc array of strings. Each string is a name of a faculty in the department given as an argument. If the department id does not exist an empty array is returned.

officeDataFor
Has one argument a string. This string is the name of the a faculty member as returned by the facultyIn method. The officeDataFor method returns an xml-rpc array of strings. The first element of the string is the name of the faculty. The second element is the office of the faculty. The third element is the phone number for the faculty. If the faculty name given does not exist then an empty xml-rpc array is returned.
delayDepartments
Has one argument a number. The argument indicates the number of seconds for the server to delay before returning the same data as does departments. This is a very unusual thing to do. It exists to help you test your client’s reaction to delays.
If you request a method that is not supported by the server it returns a fault. In the Java Xml-Rpc client this throws the org.apache.xmlrpc.XmlRpcException. In the Smalltalk client the method will returns a XmlRpcFault object.

Problems

0. Write a client program to test each of the functions on server.

1. Write a GUI base client to allow users to look up faculty office numbers and phone numbers.

2. Write a threaded GUI base client as to allow users to look up faculty office numbers and phone numbers. If a request takes too long, the user can click on a cancel button to cancel the operation. The goal of this problem is to get practice dealing with threads, so Java implementation are not allowed to use executeAsync.

Questions for Thought

1. There are a number of problems with the protocol (the methods listed above) for interacting with the server. As you work on the client see if you find ideas that would improve the protocol. You are not being asked to create your own server, but to think about how it could be improved.

2. One student commented that passing xml-rpc structs between the client and server would be expensive. Can you estimate how long it might be taking? On a small sample of requests the server reported taking about 40 milliseconds to handle the request. That is the time between when it received the request and the time it send back the response.

3. Would it be better for officeDataFor to return a struct with key-value pairs or an array as does now? Which would be easier for the client to handle.

4. Would it be better for departments to return a struct with key-value pairs or an array of arrays? Which would be easier for the client to handle.


Language

The assignment is to be done using the language in which you qualified for the course: Smalltalk or Java.

Grading


Percent of Grade
Working Code
40%
Comments
20%
Quality of Code
40%

Working Code. How well your code meets the functional requirements listed above accounts for 40% of the grade for the assignment.

Comments. Having the appropriate comments in your code will count for 20% of the grade.

Quality of Code. Having good quality of code counts for 40% of the grade. Quality of code includes formatting, names and modularity.

For more information about comments and quality of code see the lecture notes of past CS535 courses. For even more information see Code Complete, McConnell, Microsoft Press, 1993. Smalltalk programmers can look at Smalltalk Best Practice Patterns, Beck, Prentice Hall PTR, 1997

What to Turn in

Turn in hard copy and an electronic copy of your code for problem 2. You can place the code on a floppy. I am working on a system to submit source code online.

Late Policy

See the course syllabus for the late policy.


Copyright ©, All rights reserved.
2002 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

    visitors since 11-Sep-02