I have provided the following resources for this exercise:

· A character file [url removed, login to view] which contains details of the products. This must be stored in the same directory as the server detailed in the next bullet point and the code for the business object. You will not need to change this.

· The complete source code of the server in the class You will not need to change this.

· The complete source code for the business object You will not need to change this.

· The code for the client solution in the class

· The code for the exercise in [url removed, login to view]

In this exercise I would like you to develop some of the code for the client used within a very simple ecommerce application which is designed in three layers. The first layer (the database layer) consists of a Properties database and a server which accesses it. A Properties object is a file-based data structure which has the same functionality as a Hashtable. The database associated with this data structure is shown below:



Scsb=Blue Socks*1500*

Scsy=Yellow Socks*200*

It is a simple database which relates a unique key with the name of a retail product and the current quantity in stock of that product; so, for example, the first line states that Sh1 will be the key for shirts and currently there are 200 in stock. In the database asterisks are used to terminate sub-fields.

The server is very simple: all it does is to continually loop around waiting for messages from clients and acting on them.

The middle layer is implemented using business objects defined by the class Product. This has two instance variables (both strings). The first represents the number in stock of the product and the second represents the name of the product. The class Product consists of two methods which retrieve the instance variables, a static method which initializes the database containing product details and a constructor. The constructor takes a key as an argument and creates an object associated with the key. If the key does not exist in the database then a Product object is still created; however, it will have both its

instance variables set to the string value "Error".

The final layer is the client. This consists of a frame that contains three buttons, a text field and a text area. The product button, when clicked, will take the string in the text field and send a message to the server asking for the name of the product corresponding to the key. When this is returned it is displayed in the text area. The quantity button, when clicked, will take the string in the text field and send a message to the server asking for the quantity in stock of the product corresponding to the key. When this is returned it will be displayed in the text area. In each of the two cases above the server will send a string back representing the data required. If the server is unable to find the product in its

database then it just sends back an asterisk. The third button quits the application.

The client communicates with the server using a simple protocol: if it requires the

quantity in stock of a product it will send a ‘Q’ character followed by the key; if it

requires the name of a product then it sends an ‘I’ character followed by the key.

The tasks that I would like you to carry out are to fill in the missing code which sends a message to the server when the name of the product is asked for and processes the string which returns from the server. I have already implemented the error processing that is needed. The code required should really be only two lines in length.

I want you to carry out the following tasks:

· Read the code in the class Product which represents the business object and understand it.

· Read the code in the class ECommerceServer and understand it.

· Execute the server. It should issue messages indicating that it has started and is waiting for a connection.

· Run the client solution. This will execute the code within EClientSolution. Convince yourself that it is working by typing in some of the product keys, for example Tie.

· Quit the client by clicking the quit button.

· Read the code in EClient which occurs after the ignored section. In the code for processing the product button there are two missing lines. Understand the processing that is going on.

· Supply the missing code, there are only a couple of lines.

· Execute the EClient code and check that you have correctly programmed the example.

· Quit the client by clicking the quit button.

· Explain what is happening in this three-tier architecture.

Taidot: Java

Näytä lisää: yellow objects, yellow character, what is data structure, what is a data structure explain, what data structure, what are the application of data structure, what are data structure, string source code java, string processing in c, string in data structure, string find c, string data structure, set in data structure, set data structure, q find, products designed, loop back, key data structure, i want on line business, hashtable data structure in java, hashtable data structure, first class objects in java, find character in string c, explain data structure, data structure solution

Tietoa työnantajasta:
( 7 arvostelua ) Margate, United States

Projektin tunnus: #426812

Myönnetty käyttäjälle:


Dear sir, I can do it for you, Could you see PMB for more details? Thanks. Best Regards.

$30 USD 0 päivässä
(55 Arvostelua)

10 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön


Hi, Please check pmb

$200 USD 3 päivässä
(13 arvostelua)

Dear friend pls see pmb for more details

$50 USD 0 päivässä
(54 arvostelua)

Hi, I am interested in your project.

$30 USD 1 päivässä
(46 arvostelua)

I have carefully reviewed your requirement and code, I think I can help you to implement your exercise.

$100 USD 5 päivässä
(1 arvostelu)

I have this done for you now. I can supply as soon as you accept my bid. Please see PMB.

$60 USD 0 päivässä
(0 arvostelua)

Hi, I had thoroughly read the requirements and viewed the code. I can get this project done professionally. Thanks.

$100 USD 3 päivässä
(0 arvostelua)

Hello Sir/Madam, Lets start this project. I am sun certified java programmer so i can complete your task very easily with 100% Quality in agreed time period. I have understood your requirement waiting for your reply t Lisää

$100 USD 2 päivässä
(0 arvostelua)

Hi, I have gone through your requirement and supplied code. I will deliver it to you within a day with description. thanks

$75 USD 1 päivässä
(0 arvostelua)

The whole program should be check out and then have to fill up your standard requirements

$100 USD 7 päivässä
(0 arvostelua)