Comp 90015 Assignment 1
Comp 90015 Assignment 1
Comp 90015 Assignment 1
Note: In worker-pool architectures, the server creates a fixed pool of worker threads and uses them to
process clients requests.
Hence, the assignment must make an EXPLICIT use of the two above. By explicit, I mean that in your
application Sockets and Threads must be the lowest level of abstraction for network communication and
concurrency.
Implementation Guidelines (but you are most welcome to come out with
your own design/ interfaces)
Design two components:
a server, which maintains the dictionary. The server must maintain a dictionary file containing
the list of words and their meaning, and a support structure for speeding up the dictionary
search respectively. The server must serve multiple clients concurrently. Threads on a workerpool must be used to achieve this functionality.
a client, which is used to query the server for the meaning of a given word. The client should
implement a function that is used to query the dictionary with the following input/output:
1. Input: string (word to search)
2. Output: status code (found, not found, error) and String[] (meaning(s) of the word)
A possible example of the function is the following:
RemoteDictionary dictionary = new RemoteDictionary(address, port);
Result result = dictionary.search("Assignment");
where:
RemoteDictionary is the class implementing the access to the remote dictionary and the search
method.
Result is the class containing two properties (int errorCode, String[] meanings).
A call to the search method results into the client application establishing a connection to the server by
opening a socket on <address, port>. The specific protocol used to query and exchange data with the
server is left to the student to decide. However, it is important to notice that the communication has to
be RELIABLE. This means that an infrastructure allowing reliable communication over UDP has to be
implemented.
Error Handling
It is expected that, on both the server and the client side, errors (by means of exception handling) are
properly managed. The errors include the following:
input from the console for what concerns the parameters passed as command line
network communication (address not reachable, bad data...)
I/O to and from disk (cannot find the dictionary file, error reading the file, etc...)
other errors you might come up with
The application will be tested and validated against all these errors.
Implementation Language
The assignment must be implemented in Java. Utilization of technologies such as RMI and JMS are not
allowed.
Please mind that the report is a WRITTEN document, do not put only graphs. A report without any
descriptive text addressing the problem, architecture, protocols, and the analysis of the work done will
not be considered valid.
The length of the report is not fixed. A good report is auto-consistent and contains all the required
information for understanding and evaluating the work done. Given the level of complexity of the
assignment, a report in the range of 4 to 8 pages is a reasonable. Please mind that the length of the
report is simply a guideline to help you in avoiding an extremely long or insufficient report.
It is important to put your details (name, surname, student id) in:
This will help to avoid any mistakes in locating the assignment and its components on both sides.
Deadline
The assignment must be handed at the following email address of Rodrigo: ([email protected]). A
compressed file containing the following directory structure is expected:
The compressed file must be named with your Student ID (<student-id>.zip) or (<student-id>.tgz).
The deadline for submission of the assignment is: Tuesday 27 August (5 pm).
For all of the above elements, the assignment will be evaluated 60% (6 marks) of the whole mark. The
rest of the marks are assigned to two elements:
excellence (3 marks - 2 for code, 1 for report). The assignment has not only be implemented by
using the minimum requirements but a smart design has been done, a proper interaction with
the user has been provided (notification of errors, which really help to understand what went
wrong) and most importantly the code documentation! For what concerns the report excellence
the report is flawless and well written with the proper graphs and a complete discussion and
analysis of the code implemented (i.e.: scalability with tests across different dimensions such as
number of concurrent connections and size of the dictionary).
creativity and plus (1 mark). Any additional implementation such as a GUI for managing the
client or the server or other enhancements to the code introducing advanced features (such as
processing of user requests within a server in scalable, reliable, and efficient manner) will be
considered a plus.
NOTE (EXTREMELY IMPORTANT): the excellence and the creativity and plus marks (4 marks)
cannot compensate any lack in the first part (the one that scores up to 6 marks). Please
concentrate your efforts in getting the first 6 marks done and then proceed with the rest.
You are free to develop your system where you are more comfortable with (at home, on one pc, on your
laptop, in the labs...) but the assignment is meant to be a distributed system that works on at least two
different machines in order to separate the client from the server.
After the submission of the assignment, please demo as per the schedule published on the subject web.
Further Info: If you need any clarification on the Assignment, kindly ask
questions during the lectures, so that all students benefit from it. Any
serious issue, please contact Rodrigo: ([email protected]).