eQuotes

Implementation Phase I

Group members:

Arpan Biswas

Gaurav Sharma

Ajay Mansata

Sameer Yeolekar

e-Quotes

Introduction

eQuotes aims to establish an application delivered as a service that can be integrated with other Web Services using Internet standards. In other words, it's an URL-addressable resource that programmatically returns information to clients who want to use it. The e-Quotes is a Stock Exchange Web Service based system which comprises of at least one client and one or more servers hosting web services. It extends the component-based architecture by making the distributed components communicate with Simple Object Access Protocol (SOAP) and Extensible Markup Language (XML) to eradicate the object-model-specific protocol barrier. Web Services also eradicate the need for the client entity to access the resources of the server directly.

Web Interface

Home Page:

This is the first page which gets loaded when the client accesses the website.

Individual Stock Display:

This page is displayed when the user selects the Individual Stock option from the home page. It gives the option of choosing the company name from a drop down list as well as choosing the stock exchanges from where the information needs to be retrieved.

When the choices have been made, the user clicks the GET QUOTES button, which results in the following page to be displayed.

Compare Prices:

On the main page if the COMPARE PRICES option is selected then the user is given a choice of the companies and the various stock exchanges which have been subscribed to, would be allowed to advertise.

This depicts the stock quotes of the companies on various Stock Exchanges.

Stock Exchange Info:

On the home page .If the user selects the option of Individual Stock Exchange the following page shall be provided to the user. On this page the user is able to select the stock exchange about which it wants to retrieve the information.

Exchange info:

Once the button has been clicked, the database manager retrievesall the information from the client database

Test Cases

Client side

Test Case # / Condition / Outcome
1 / Accessing Home Page. / The home page gets loaded.
2 / Providing the Options to the user. The user has to select one of them in order to proceed. / The page corresponding to the option selected is loaded
3 / Providing the Company Name and the various stock exchanges to which the client has subscribed. / The stock information of company selected at the selected stock exchanges is displayed.
If the company is not listed at the chosen Stock Exchange then no result is displayed.
4 / Providing a drop down list, which contains the names of the various companies of whom, the user wants to have a comparative analysis along with the option to choose the stock exchange from where he wants the information to be retrieved. / Depending upon the companies and the stock exchange chosen, the result is displayed in a tabular format. If one of the companies is not listed in the stock exchange selected, then the comparative result will not be displayed.
5 / Selecting a particular stock exchange from the list provided to view the performance of the selected stock exchange / Depending upon the stock exchange chosen its daily performance is displayed.
6 / Client Database Manager receives the XML document from the Client request /response handler. / Success: If the XML document has nodes, then it is parsed and the corresponding information is updated in the client database.
Failure: If the XML document does not have any nodes, it implies that the data sent is stale and will not be processed.
7 / The Client Request/Response Handler receives the invocation message from the polling manager. / It prepares an XML request document and sends it to the Server.

Server side

Test Case # / Condition / Outcome
1 / The client request/response handler calls the server request response handler of the Web Service. / The Server request/response handler receives the request and invokes the Operations Manager.
Success: The Server request/response handler receives a well formatted XML document for forwarding.
Failure: If the client is not valid the
Server request/response handler receives an empty XML document. (The client checking part is still under development phase)
2 / Operations Manager invokes the Server Database Manager to retrieve information from the database. / The Server Database Manager fetches all the recently changed records from the database and passes them into a dataset.
Success: The dataset is properly populated
Failure: The dataset is empty
3 / The Operations Manager retrieves the dataset and parses it to modify it further by adding some more attributes to identify the exchange. / Success: The XML document is ready for forwarding to the client.
Failure: Error handler is called, which creates an empty XML document which conforms to the required format if an error occurs.

Implementation Status Report

1)Work Completed

At present the client side of the project is able to communicate with 2 separate Web Services, each implemented for a different stock exchange. The client retrieves stock information using these Web Services by constantly sending requests after some interval of time, in order to provide the user with the latest information.

Database Design:

This was the foremost thing that was done. The tables are created using MS-Access. The tables created are:

At the Server –

StockExchangeInfo: This table will hold the index values of the stock exchange. For e.g. if the server is of NY Stock Exchange, then it would contain the information regarding the opening index, closing index and the difference between the day’s opening and closing index.

CurrentTable: This table holds the information pertaining to those companies whose values have changed since trading has begun at the stock exchange. This table also consists of a field flag, which is used to indicate whether the information regarding that particular listing has been sent to the client. Essentially, as the day progresses the stock prices change and this table holds the latest stock information.

MasterTable: This table holds the information of all the companies, which are listed on that particular Stock Exchange. This table is updated at the end of the day.

At the Client – All the tables at the Client hold the information from the various Web Services it has subscribed to. The information is stored on the basis of the company name as well as the Stock Exchange at which that company is listed.

ClientTransaction: This table is used to store the updated information arriving from the various stock exchange web services at a set interval. The interval is set in the polling manager. This table is used to provide the latest information regarding the companies listed in various stock exchanges.
StockExchangeInfo: This table stores the information pertaining to the performance of the various Stock Exchanges and is used in providing the omparative performance analysis between the various stock exchanges.

MasterTable: This table stores the complete history of the various companies isted in the different stock exchanges. It is used to provide a comparative analysis between the various companies or the performance analysis of an individually company on a daily basis.

Person: Ajay and Sameer.

Time: 7 to 8 man-hours

Message Format:

The message format is one of the most important entities in this e-Quotes System. The exchange of information between the Client Request Response Handler and the Server Request Response Handler is in the form of XML documents. The Operations Manager is responsible for retrieving the values from the server database and creating an XML document with elements corresponding to the tables in the database.

Person: Gaurav, Ajay, Sameer and Arpan.

Time: 15 man-hours

Example:

<StockQuotes exchange_name = "NYStockExchange>

<quote>

<company_name>Microsoft<\company_name>

< current_price>455< \current_price>

</quote>

<quote>

<company_name>ATT<\company_name>

< current_price>334< \current_price>

</quote>

<company_info>

<company_name>Microsoft<\company_name>

<today_high>455<\today_high>

<today_low>441<\today_low>

<today_opening>451<\today_opening>

<today_closing>444<\today_closing>

<difference>5.7<\difference>

<\company_info>

<company_info>

<company_name>ATT<\company_name>

<today_high>465<\today_high>

<today_low>421<\today_low>

<today_opening>451<\today_opening>

<today_closing>434<\today_closing>

<difference>6.7<\difference>

<\company_info>

<index>

<opening_index>782<\ opening_index>

<closing_index>786<\closing_index>

<difference>16.37<\difference>

<\index>

</StockQuotes>

GUI – Analysis and Design

The graphical representation of the entire application is designed and tested. The GUI is user friendly and has been developed using ASP.NET and FrontPage. The information requested by the user is processed here and the required information is searched in the database, retrieved and displayed to the User.

Person: Ajay and Sameer.

Time: 12 to 13 man-hours

Polling Manager:

This component is responsible for invoking the updated information from the Server. It maintains a timer and every time it expires the request for updated information is sent to the Client Request / Response Handler.

Person: Gaurav

Time: 1 man-hour

Client Request Response Handler:

This component prepares the request for the information in XML format and also receives the updated information in XML format. It then invokes an instance of Client Database Manager.

Person: Gaurav and Arpan

Time: 2 man-hours.

Client Database Manager:

It parses the XML document and if valid data is present then it inserts them into the database at the Client side. If an error of any kind is encountered then the client error handler is invoked.

Person: Gaurav and Arpan.

Time: 7 to 8 man-hours

Example:

if (quotesNode.HasChildNodes)

{

if (quotesNode.ChildNodes[i].Name == "quote")

{

int tag_count = 0;

for(int k=0;k<companyname.Length;k++)

{ if((companyname[k]==

quotesNode.ChildNodes[i].

ChildNodes[tag_count].InnerText) & (companynamestockexchange[k]==quotesNode.Attributes[0].Value))

{

string dbInsert=null;

dbInsert="update clienttransaction

set current_price='" + quotesNode.ChildNodes[i].ChildNodes[tag_count + 1].InnerText + "' where ( company_name='" + quotesNode.ChildNodes[i].ChildNodes[tag_count].InnerText + "' and stock_exchange='" + quotesNode.Attributes[0].Value + "')";

}

else{

dbInsert="insert into clienttransaction (company_name,stock_exchange,current_price) values ('" + quotesNode.ChildNodes[i].ChildNodes[tag_count].InnerText + "','" + quotesNode.Attributes[0].Value +"','" + quotesNode.ChildNodes[i].ChildNodes[tag_count + 1].InnerText + "')";

}

Server Request / Response Handler:

This component receives the XML request document from the client request /response handler and sends it to the Operations Manager for further processing. Once the request has been processed, the response is created which is in XML form sent back.

Person: Gaurav and Arpan.

Time: 2 to 3 man-hours

Operations Manager:

The XML request document is received and the request is parsed. The operations manager then passes the request to the Server Database Manager from where it receives the updated information. After receiving the same, the operations manager then sets the attributes value and creates an XML document containing the updated information which would be send to the Client Request/ Response Handler via the Server Request/Response Handler.

Person: Gaurav and Arpan.

Time: 7 to 8 man-hours

Server Database Manager:

After receiving the request from the Operations Manager, the database manager retrieves the information from the database selecting only those records whose flag field is set (indicating that they have been updated from the last time the information was sent to the client).

Person: Gaurav and Arpan.

Time: 4 to 5 man-hours

2)Work to be Completed

Operations Manager – The operations manager is responsible for the various validation techniques anddetermines how the data should be forwarded to the client. The following methods, which are used in validating the data, remain to be implemented.

private Boolean validateClient() – check in the list, which is maintained at the server, whether the client is a valid client.

private Boolean checkLastPolled() – if validateClient() returns a true value, then this method would be called. This would check the last time the server was requested for the updated stock data. If the time is greater than the threshold value set, only then the update request from the client will be forwarded else it would be processed by the Server Error Handler.

private Boolean updateLog()– this method is used to update the log file which is used to store the last time a particular client received the updated stock data.

Creating COM objects – Making the system truly distributed by identifying and making the necessary components as COM objects.

Server Error Handler – This component would be responsible for creating a null XML document in case any of the validation techniques listed above returns a false.
Providing a graphical view – At present, the results of a particular company’s daily performance or comparing the performance between companies or stock exchanges are being displayed in a tabular form. In order to make the system more user-friendly, we propose to provide a graphical view also as depicted below:

- 1 -