Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Homework Assignment 3

SE 311: Software Architecture II

Design and Implement a Client-Server KWIC-Search System

In this assignment, you need to revise the KWIC-Search system you implemented in HW 1 to create a client-server KWIC-Search System that contains two components:

1. Search client:

The user can enter a keyword from the console, and the system will send the request to the KWIC server.

●   If the keyword is found by the server, the system will display the returned sentences containing the keyword in the console, and the keyword should be highlighted in these sentences.

    If the keyword is not found, the system will display the message returned from the server.

●    The user can configure the system to determine if a header, a footer,  or both should be added. The header will display “[X] results are found in [Y] records' ', and the footer will display time and date of the search (same as HW1).

2. KWIC server:

This component should support the following functions:

1.  Create a sentence repo (same as HW1) : The user can enter a list of sentences, in the form  of a .txt file, or from the console, configurable by the user. The system will circularly shift each  sentence by repeatedly removing the first word and appending it at the end of the line. The system will then output a list of all circular shifts of all lines in alphabetical order, in the form of a new txt file, or to the console, configurable by the user.

2. Respond to search requests from multiple clients: Write a multithreading server using       sockets which can receive the keywords from multiple clients, and search the keyword from the sentence repository:

●   If the keyword is found, return all the sentences containing the keyword both in the original sentences, and in the circular shifted sentences in alphabetical order.

   If the keyword is not found, the system will return ``[keyword] not found.”

Submission Guidelines

●   You need to submit two Java projects with source code: Search client and KWIC server. You are   to use localhost as the server.  You need to submit one .zip or .rar file, and a readme file showing us how to run your program

●    Submit a component diagram and a sequence diagram modeling the following user scenario (same as hw2):

The user enters a keyword from the console, the system will return all the sentences containing the keyword both in the original sentences, and in the circular shifted sentences in alphabetical order in the console, and the keyword will be highlighted. If the keyword is not contained in any sentences previously entered, the system will return ``[keyword] notfound.