Distributed Systems â Mock Exam â
Distributed Systems â Mock Exam â
Distributed Systems â Mock Exam â
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
1 Protocols<br />
(i) If you had to implement a protocol for remote method invocation, on which<br />
transport level protocol would you base it, UDP or TCP? Explain your answer.<br />
(5 points)<br />
(ii) Suppose you have to implement a request-reply protocol. For each of the<br />
three, UDP, TCP, and HTTP, discuss whether one could use it as the basis<br />
for the new implementation. Which one would be the most suitable and<br />
which one the least? Why?<br />
(15 points)<br />
2 Java RMI<br />
Suppose a server is to be implemented for a book shop where customers can place<br />
orders and managers can check how many copies of each book have been ordered.<br />
There are two methods to access the server,<br />
1. order, which takes four strings, name, cardNo, bookCode, and address<br />
as arguments, and stores that the customer with that name and the credit<br />
card number cardNo has ordered a copy of the book identified by bookCode<br />
to be sent to address;<br />
2. copiesOrdered, which takes a string bookCode as argument and returns<br />
an integer, representing the number of copies ordered of the book with<br />
code bookCode<br />
(i) Write down the declarations of the interfaces and the classes (including the<br />
method declarations) that have to be implemented on the server side.<br />
(12 points)<br />
(ii) Describe how you would implement a small client program that can be<br />
started from a command shell, with the book code as argument, and returns<br />
the number of copies that have been ordered.<br />
(8 points)<br />
(iii) Which compilation steps have to be made in which order before the client<br />
can be started?<br />
2<br />
(4 points)