Download Pre – Post Conditions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Concurrency control wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Database wikipedia , lookup

Relational model wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

Object-relational impedance mismatch wikipedia , lookup

Transcript
eQuotes
System Design
Group members:
Gaurav Sharma
Arpan Biswas
Ajay Mansata
Sameer Yeolekar
e-Quotes
Table of Contents
Data Dictionary .................................................................................................. 2
Sequence Diagram............................................................................................ 4
Use Case Diagram ............................................................................................ 6
System Type Model........................................................................................... 7
Operation Specification ..................................................................................... 8
Pre-Post Conditions .......................................................................................... 8
System User Interface ..................................................................................... 11
Architecture Design ......................................................................................... 15
Physical Architecture ....................................................................................... 15
Application Architecture ................................................................................... 16
Class Diagram ................................................................................................. 17
Pseudo Code................................................................................................... 18
1
e-Quotes
Data Dictionary
User Interface
Client Request/
Response Handler
Polling Manager
Client Database
Manager
Server Request/
Response Handler
Operations Manager
On being requested some
information about the performance
of a company’s share at the stock
exchange or the trading
information of a particular stock
exchange on a daily or monthly
basis, the user interface pulls out
the appropriate data from the client
side database.
This is responsible for
communication with the Web
Services server in order to receive
updates from the Stock
Exchanges. The information
received is sent to the database
for updation via the Client Error
Handler.
The Polling Manager, which
interacts with Client
Request/Response handler,
determines the frequency of
retrieval of information from a Web
Service server. The polling
frequency is controlled with the
help of a timer. After the expiration
of the timer each time, the Polling
Manager prompts the Client
Request/ Response Handler to
fetch new Stock Exchange
information from the Web Service
server.
This checks whether the data
received from the Web Service
server is in the correct format so
that the same can be sent to the
database for updation. It is
responsible for performing all the
database related operations.
This listens for the request coming
from the Client Request/Response
Handler and issues the
corresponding response.
The Operations Manager validates
the client request received by
Server Request/ Response
Handler and maintains a log file of
all the incoming requests. It first
checks whether the client is valid
and if it is then it interacts with the
2
retrieveInfo ( )
displayInfo ( )
addData ()
fetchData ()
startTimer ()
resetTimer ()
invokeRequest ()
addEntry ()
deleteEntry ()
updateEntry ()
handleRequest ()
issueResponse ()
validateClient ()
updateLog ()
fetchData ()
e-Quotes
Server Database
Manager
Server Database Manager to
retrieve the required information
and passes back to the Server
Request/ Response Handler,
otherwise it sends no useful data.
It performs the database
operations of search and retrieves
and flags all the data, which have
been updated so that only the
recently updated information would
be sent back to the client.
3
updateFlag ()
search ()
e-Quotes
Sequence Diagram
4
e-Quotes
The Polling Manager polls the Client Request/Response Handler after a specific interval
to retrieve the latest data. The Client Request/Response handler queries the Server
Request/Response Handler who validates the client. If the client is a valid one it queries
the Server DB Manager for latest data and fetches the data from the server-side
database returning it to Client Request/Response Handler. If the client is not valid, it
returns “null” data. The Client Request/Response Handler then invokes the Client DB
Manager for validation of the data and then its addition to the client-side database. The
data is validated at the Client DB Manager and added to the database if valid. The user
can then retrieve information by interacting with the user interface.
There is no coupling between the User Interface and the Client DB Manager. Thus there
is no dependency on the working of the underlying architecture of the system. The User
Interface can be modified as per the user convenience.
5
e-Quotes
Use Case Diagram
6
e-Quotes
System Type Model
eQuotes
*
*
1
retrieveInfo()
handleRequest()
fetchData()
updateFlag()
*
1
displayInfo()
addData()
addEntry()
search()
1
startTimer()
fetchData()
deleteEntry()
7
resetTimer()
validateClient()
updateEntry()
invokeRequest()
updateLog()
checkData()
e-Quotes
Operation Specification
Pre-Post Conditions
At Web Service Client
User Interface
retrieveInfo()
Pre: Client wishes to retrieve some stock information.
Post: Search operations performed and result returned.
displayResult()
Pre: No result displayed.
Post: Result displayed.
Polling Manager
startTimer()
Pre: Timer has expired.
Post: Start timer for polling.
resetTimer()
Pre: Timer is running.
Post: Reset timer for new cycle to begin.
invokeRequest()
Pre: No request has been sent
Post: Request has been sent for getting the latest quotes.
Client Request/Response Handler
addData()
Pre: Database as it is.
Post: New record sent to Client Error Handler for validation.
fetchData()
Pre: Current data to be fetched from the Web Service.
Post: Latest data received from the Web Service.
8
e-Quotes
Client Database Manager
checkData()
Pre: Data received from the Client Request/Response Handler.
Post: Data verified.
addEntry()
Pre: Database as it is.
Post: New Entry received from the Web Service added to one of the tables in the
database.
deleteEntry()
Pre: Database as it is.
Post: Entry deleted from one of the tables in the database.
updateEntry()
Pre: Database as it is.
Post: Update the latest data received from the Web Service.
At the Web Service Server
Server Request/Response Handler
handleRequest()
Pre: No new request received from the client.
Post: Request handled.
Operations Manager
validateClient()
Pre: Valid client list exists.
Post: Client verified.
updateLog()
Pre: Last entry for the client in the log file is older than the threshold time.
Post: Entry for the client updated for the last request time of the client.
fetchData()
Pre: Need to search for information requested by the client.
Post: Information retrieved and sent to the Server Request/Response Handler.
Server Database Manager
search()
Pre: Some information to be searched.
9
e-Quotes
Post: Performed search and result returned.
updateFlag()
Pre: Flag set/reset
Post: Flag reset/set.
10
e-Quotes
System User Interface
The initial page:
List quotes of one or more companies at different stock exchanges:
11
e-Quotes
The result of the above request:
To compare 2 companies at one or more stock exchanges:
12
e-Quotes
The result of the above comparison:
13
e-Quotes
To view the details of the whole day at a particular Stock Exchange:
The result of the above request:
14
e-Quotes
Architecture Design
Physical Architecture
Views/Methods
Web Service Client
UI
<<SOAP>>
<<SOAP>>
Web Service Server
15
e-Quotes
Application Architecture
Client
Database
Manager
<<SQL>>
Client
Database
UI
Client Request
/ Response
Handler
Polling
Manager
<<SOAP>>
<<SOAP>>
Server Request /
Response
Handler
Server
Database
Manager
Operations
Manager
16
<<SQL>>
Server
Database
e-Quotes
Class Diagram
17
e-Quotes
Pseudo Code
User Interface
Description: The user class handles the client queries and is responsible for retrieving
and displaying the results.
public User_Interface
{
public String retrieveInfo()
{
The information that the user seeks is passed to the Client Database
Manager for retrieval.
}
private void displayResult ( )
{
Display the data on the GUI which has been retrieved in an appropriate
format.
}
}
Polling Manager
Description: Responsible for polling the server for recently updated stock information.
public Polling_Manager
{
private System.Timers.Timer aTimer;
private void startTimer()
{
//This initiates the timer which keeps a track of the
//time elapsed since the last data was fetched from
//the Web Services server. If the time has elapsed it
//will call the invokeRequest() method.
//Start the timer which continuously polls the
//subscribed Web Services
aTimer = new System.Timers.Timer();
// When the timer elapses the invokeRequest method is
//called.
aTimer.Elapsed+=new
System.Timers.ElapsedEventHandler(this.invokeRequest);
// Set the polling time to 10 seconds.
aTimer.Interval=10000;
18
e-Quotes
aTimer.Enabled=true;
}
private void invokeRequest()
{
//Once this method receives information that the timer
//has elapsed, it will invoke Client
//Request/Response’s fetchData() method.
ClientRequestHandler requestHandler = new
ClientRequestHandler();
string result = requestHandler.fetchData(user, pass,
url);
}
private void resetTimer()
{
//This resets the timer to begin a new cycle for
//polling the server for data.
aTimer.reset();
}
}
Client Request/Response Handler
Description: It communicates with the Web Services server in order to receive the
updated stock market information.
public Client_Handler
{
String quotes = null;
public String fetchData ()
{
//The Polling Manager invokes this method and it is
//responsible for sending the request to the server
//for the updated data about the stock exchanges.
// invoke the web service client
eQuotesClient eQuotes_client = new eQuotesClient ();
// Set the access point where the Web Service can be
// accessed.
eQuotes_client.Url = url;
// call the eQuotesClient method to fetch quotes
quotes = eQuotes_client.handleRequest();
}
19
e-Quotes
private void addData()
{
//It receives the data from the server and sends it to
//the Client Error Handler for validation.
// Initialize the database manager to insert the
// recieved data into the client database
ClientDBManager service_data = new ClientDBManager();
service_data.addEntry(quotes);
}
}
Client DataBase Manager
Description: It is responsible for checking the validity of the data & all the database
related functionalities.
public Client_Database_Manager
{
public void addEntry(String quotes)
{
//This adds the validated data to the table.
Boolean validData = checkData(quotes);
If (validData == true)
// add entry in the database
else
Console.WriteLine(“Stockexchange not responding”);
}
public void deleteEntry()
{
//This deletes the old entries from the table.
}
public void updateEntry()
{
//This updates the table.
}
public Boolean checkData(String quotes)
{
//This checks the validity of the data.
20
e-Quotes
If (quotesValid == true)
return true;
else
return false;
}
}
Server Request/Response Handler
Description: It listens for the incoming request and takes the appropriate actions to
send the response back to the Client Request/Response Handler.
public Server_Handler
{
String quotes;
public String handleRequest()
{
//Accept the incoming request, parse it and pass it on
//to the Operations Manager.
OperationsManager op = new OperationsManager();
quotes = Op.fetchData();
}
}
Operations Manager
Description: It receives the requested information from the Server Request/Response
Handler & performs various validation techniques and decides how the data should be
forwarded back to the client.
public Operations_Manager
{
public String fetchData()
{
//The requested information is searched and sent to
//the Server Request/Response Handler for sending the
//response back to the client.
String data;
Boolean validation = ValidateClient();
If (validation == true)
21
e-Quotes
//get the latest data from the database
data = datafromdatabase;
else
//create null data
data = null;
return data;
}
private Boolean validateClient()
{
//It checks whether the client is a valid client. The
//client is searched in a valid client list that the
//server maintains. If it’s a valid client it will
//then invoke the checkLastPolled () method.
}
private Boolean updateLog()
{
// It updates the log file with the time at which the
//request has been received.
}
}
Server DataBase Manager
Description: It handles the incoming request from the server and performs the database
functions.
public Server_Database_Manager
{
public String search()
{
//This performs the search operations and retrieves
//all the updated information. In case the flag is set
//then it would imply that the information is stale
//and the record will not be selected to be sent to
//the client. Otherwise the information is fresh and
//is formatted and sent back.
}
private Boolean updateFlag()
{
//If the record has been selected to be sent as part
//of the updated dataset then this message would set
//the corresponding flag.
}
}
22