COIT132229 Applied Distributed Systems Assignment


Added on  2019-09-27

4 Pages1106 Words91 Views
COIT132229 Applied Distributed Systems Assignment 2 – Java Remote Method Invocation ApplicationDue date:Week 11 Friday (31thMay 2019) 11:45 PM AESTASSESSMENTWeighting:35% 2ObjectivesThis 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 OrderClientand 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 ServerBookfor processing. Similarly, if it is a movie order, this coordinator server sends the object to another server named ServerMovie. The objects from ServerBook or ServerMovieare then sent back to ServerCoordinator to send toOrderClient. ServerCoordinator should keep track and display the number of requests sent from client.

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/Deserializationshould 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:

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Client-Server Architecture and TCP Byte Transition Protocol

Report on Advance Web Solutions

Faculty of Information & Communication Technology

Security Measures for Hybrid Cloud Implementation

Report on Enterprise Software Development

Understanding the Use of Cookies in Computer Networks