Multi Threading Model | Java
Java multi-threading model and client/server model are the fundamental Java components to build distributed applications. In this assignment, you are to develop programming skills of these components or models via a particular application – a simplified client/server information query system. The Java multithreading and client/server components have been introduced through weekly lectures, tutorials and lab projects of this unit; you should ensure that you have good understanding of these learning materials before you start this assignment. In this assignment, you will need to integrate what you have learnt to develop a simple client/server system to query students, subject units and unit enrolment information.
Part 1: Query client and query server design and implementation
- The query client is a query frontend application, running in a network computer and providing options to:
- Query students’ contact details
- Query students’ enrolled units
- Query unit details
The query frontend client provides a menu to let a user choose any of these options continuously until the user chooses to exit the system. Once it accepts an option and related information, it will send a query request to the remote server. The client accepts the response from the server and displays the query results to the user. To construct such a client, you will need to use Java UDP datagrams to encapsulate the user’s request and a Java UDP datagram socket to communicate with the remote server. The interface of a reference implementation of such a query client is shown in Fig 1.
- The query server is running on another network computer, accepting and parsing a client’s request to interpret the query. The server can distinguish the above 3 different query options. For each request it receives, the server creates a thread to complete the query and sends the result back to the query client. To be consistent with the client, the server needs to use Java UDP datagrams to encapsulate a query result and a Java UDP datagram socket to communicate with the remote client. The interface of a reference implementation of such a query server is shown in Fig 2. Please note the server’s output in Fig 2 is to display some queries and results for understanding purpose but not essentially necessary. That is, the server does not have to output anything on a terminal.
Fig 1. The interface of query client
Fig 2. The interface of query server
You will need to design and implement the query client, query server and associated student, subject unit and enrollment entities and processing threads by using standard Java language.
Note: you do not need 2 computers to test the system; you will need to run the query cleintand query server on 2 Java Virtual Machines (JVMs) of a physical machines as illustrated in Fig 1 and Fig 2.
Part 2: Documentation
After the implementation of the framework, prepare a document to include:
- An end user’ instruction about how to compile, run and test your system.
- The limitations of the current system and suggestions for future improvement.
Submission
You need to provide the following files in your submission.
- Implementation files
- Files of Java source code of the implementation. The in-line comments on the data structure and program structure in the programs are required. These source code files must be able to be compiled by the standard JDK (Java Development Kit) or NetBeans from Oracle
- The compiled Java class files of the source code. These Java classes must be runnable on the standard Java Runtime Environment (JRE) or NetBeans from Oracle
- A Microsoft Word document to address the issues as specified in Part 2 above.
All the required files must be compressed into a zip file for submission. You must submit your assignment via the online submission system from the unit web site. Any hardcopy or email submission will not be accepted. After the marked assignments are returned, any late submissions will not be accepted.
Marking Criteria
Marking Criteria | Available Marks | |
1. The Query Client | 10 | |
• Whether the query client is compilable and runnable | 2 | |
• Whether UDP is correctly used to communicate to the | 2 | |
remote server | ||
• Whether the structure of query client is sound | 3 | ||
• Whether the user’s request is correctly constructed | 2 | ||
• Program readability and necessary in-line comments | 1 | ||
2. | The Query Server | 15 | |
• Whether the server is compilable and runnable | 2 | ||
• | Whether UDP is correctly used to communicate to the | 2 | |
remote client | |||
• Whether the structure of query server is sound | 3 | ||
• Whether the query server is correctly multithreaded | 2 | ||
• Whether necessary entities (student, unit, enrolment) are | 3 | ||
correctly constructed | |||
• Whether the user’s request can be correctly parsed | 2 | ||
• Program readability and necessary in-line comments | 1 | ||
3. | Documentation | 5 | |
• | Whether the user’s instruction is clear and covers the | 3 | |
system function | |||
• Limitations of the system and suggestions for | 2 | ||
improvement | |||
Sub Total for Assignment 1 | 30 | ||
Late Penalty | -1.5 (5% each calendar | ||
day, either full or partial) | |||
Plagiarism Penalty | |||
Total for Assignment 1 | |||
visit at : Object Oriented Program | Game
No comments:
Post a Comment