COIT132229: Java RMI Application Assignment 2 - Online Store

Verified

Added on  2019/09/27

|4
|1106
|91
Project
AI Summary
This assignment requires the development of a Java RMI application for an online store, utilizing a TCP client/server model. The system involves three servers: a ServerCoordinator that manages client requests and routes them to either a ServerBook or ServerMovie based on the order type (book or movie). Both BookOrder and MovieOrder classes store order details, calculate total bills with different tax rates (10% for books, 30% for movies), and implement the Task interface. The application uses Java object serialization/deserialization for communication between clients and servers. The OrderClient allows users to input order details, which are then processed by the appropriate server. The ServerCoordinator keeps track of requests, while ServerBook and ServerMovie compute total bills. The assignment includes error handling, input validation, and a report with end-user instructions, test manual, screenshots, and descriptions of the program's functionality. The submission includes source code files for all classes and the report document.
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
COIT132229 Applied Distributed Systems
Assignment 2 – Java Remote Method Invocation Application
Due date: Week 11 Friday (31th May 2019) 11:45 PM AEST ASSESSMENT
Weighting: 35% 2
Objectives
This assessment item is designed to test your understanding in Java TCP networking with multiple
servers, Java Object Serialization\Deserialization, Java Class Interface.
The Case
An online store selling two productions (Book and Movie) would like to create an application that
allows customer to purchase their productions. The application should be implemented using TCP
client/server model, where client can enter basic order information and the system will calculate total
bill and return to client. The store needs to server a large number of customers; they need two servers to
handle the operations of each product type separately (one Server for Book and another Server for
Movie). The communications between client and the system are handled by another server acting as a
coordinator. The coordinator server receives order information from client send to the server of the
corresponding product type for calculating total bill. The computed information is then sent back to the
coordinator to pass onto client.
Specific Requirement
A. Programming
You can use the following class descriptions as a guideline for your design.
1. The program should have two classes for BookOrder and MovieOrder to stores order details of
Book and Movie. Both Classes should contain appropriate properties to store order information
such as Quantity, Unit Price, Tax, Total Bill. Constructor(s) and Get and Set functions should be
implemented in this class. In addition, these classes should implement two functions
executeTask() and getResult() of a Java Class Interface Task (Refer to JavaClassInterface
example in Week 6 for reference) to compute the Total Bill Values and output message. Note
that there is different tax rates applied to different products. The Book order will have 10% tax,
while the Movie order will have 30% tax.
2. OrderClient: This program asks user to select which product to order, and then asks for user
inputs for Quantity and Unit Price. The created object will then be sent to as a server named
ServerCoordinator using TCP Connection and print out total bill information after receiving
returned object from the servers.
3. There are three servers needed in the application:
ServerCoordinator: This program receives object sent from OrderClient and determines
whether the order is for Book or Movie. If it is a book order, this coordinator server sends the
object to another server named ServerBook for processing. Similarly, if it is a movie order, this
coordinator server sends the object to another server named ServerMovie. The objects from
ServerBook or ServerMovie are then sent back to ServerCoordinator to send to OrderClient.
ServerCoordinator should keep track and display the number of requests sent from client.
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
ServerBook: This server receives Book order from ServerCoordinator and then computes the
total bill using the executeTask() function. The computed object is then is sent back to the
ServerCoordinator. This server should keep track and display the number of Book order sent
from client.
ServerMovie: This server receives Movie order from ServerCoordinator and then computes the
total bill using the executeTask() function. This server should keep track and display the number
of Movie order sent from client.
The communication between the servers and clients are TCP connections. The socket number
should be in the following format “xxyy” where xx is the last 2 numbers on your student ID.
You can design your own numbers for the values of yy. Java object Serialization/Deserialization
should be used in the above programs where appropriate. (Refer to Week 9 and Week 11 Lab
Solutions for reference in developing these programs)
Your program should check user inputs for potential error and allow user to re-enter details where
appropriate. Exception and error handling should be implemented within your program where necessary.
The source code should be formatted properly following good programing practice (appropriate variable
names, indentation, comments, etc.…)
Example outputs:
The following screenshots show example outputs of the above program. You should only use
these as references. Your program outputs can be similar but not necessarily the same. You should
customize the messages on clients and servers for your own program.
Assume that OrderClient is run on two Java Virtual Machines:
Client 1 Client 2
Output of ServerBook:
Document Page
Output of ServerMovie:
Output of ServerCoordinator:
B. Report
After the implementing the program, prepare an end user instruction and test manual. Run the program
and take screenshot of program outputs, provide description on the outputs and how your program
works. The test should demonstrate that your ServerCoordinator can accept connection with more than
one OrderClient. The test should show at least 4 orders. Screenshots of the outputs of all server and
client programs should be provided.
Assessment Submission
You should submit one Zip file containing the following files using the Moodle online submission
system, by the due date:
Task.java – Source code for the Task Java Class Interface
BookOrder.java – Source code for the BookOrder class
MovieOrder.java – Source code for the MovieOrder class
OrderClient.java – Source code for the OrderClient class
ServerCoordinator.java – Source code for the ServerCoordinator class
ServerBook.java – Source code for the ServerBook class.
ServerMovie.java – Source code for the ServerMovie class.
Report.docx – A document file containing details as outline above.
Document Page
Assessment criteria
Note:
1. If your program doesn’t compile or run, partial marks will be allocated by inspection of the source
code.
2. Your understanding of the program will be examined using your report and the detailed java doc
comments inserted in your source code files.
3. Please clarify any doubts you have by one of the means of discussing with your tutor, posting a
query in the Q& A forum, or discussing with your colleagues or contacting the unit coordinator.
4. Please do not share your source code files or report with your colleagues which may lead to
plagiarism.
chevron_up_icon
1 out of 4
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]