IS 313: Data Structures in Java
Autumn 2002
Individual Assignment 4
Client/Server implementation using sockets
Due Wednesday November 20 before 11:30pm
The classes CurrencyView and CurrencyAccess implement a simple
currency exchange program and access the exchange database. They have been slightly
modified from the currency programs presented earlier in the quarter.
For this assignment, you will modify the CurrencyAccess class so that
it acts as a client and obtains the currency information from a server
called CurrencyServer. This server then obtains currency information
from the database.
Your client/server program should work like the MultiTime program
discussed in class. The MultiTime program is implemented with the TimeViewer, the MultiTimeClient and the MultiTimeServer classes. In particular, your program should be structured as follows:
- Your revised CurrencyAccess class should provide the same public
methods. This way, the CurrencyView class does not need to be
modified.
- The CurrencyAccess class should look up the server host name using
a properties file called currency.properties. If this file does not
exist, your program should use "localhost" as the server host
name. See the MultiTimeClient class for an example.
- The CurrencyAccess class needs to send commands to the server so
that it can retrieve the following:
- The list of currency names
- The amount in foreign currency when given the amount in
dollars and the name of the foreign currency.
- The amount in dollars when given the amount in a foreign
currency and the name of the foreign currency.
- You will need to create commands so that your client can
successfully communicate with your server. See the MultiTimeClient
and MultiTimeServer classes for an example.
- Your CurrencyServer class can be implemented entirely using static
methods (like the MultiTimeServer class).
Submission
Before the due date and time, you should submit the following files
through the submission
Web page:
If for some reason you are unable to submit the files, you may email me
them as an attachment.