COMP333-18A Assignment Two/ Object Oriented JavaScript : Share Monitor Widget

.

COMP333-18A Assignment Two/ Object Oriented JavaScript : Share Monitor Widget

Object Oriented JavaScript : Share Monitor Widget

For this coursework you are to implement a web page component that allows a user to monitor share prices for different companies. You will use

• JavaScript, coded in an object-oriented style

• CSS for formatting and presentation styling
• DHTML (modifying web page content using JavaScript)
• Server-side PHP scripting for interaction with a mySQL database
• A mySQL database containing appropriate tables to store the data required by the application

• AJAX

Application description

• the application will be implemented in the form of a ‘widget’ – it is a self-contained component that can be inserted into any web page (subject to inclusion of any required JavaScript and CSS files)

• the user can select the company that they wish to view the price information for from a fixed list which consists of: NZ Wind Farms, Foley Wines, Geneva Finance, Xero Live, Moa Group Ltd, Solution Dynamics

• the ‘widget’ displays a list of price information (consisting of ‘price’ and ‘price change’ for each of the selected companies

• this list is updated upon request to reflect changing price information
• the user can control the order in which the companies are displayed, sorting by either the company name or the share price

• multiple instances of the widget can be created and inserted into a page to monitor different sets of companies
• information about shares is stored in a mySQL database which is updated automatically by another process (you do not need to implement the database updating)

• the widget is embedded in the page and updated without the need to reload any other components of the page

This screenshot shows the widget embedded within a web page:

• Monitoring begins when the user selects a company. A request for share data is made to the server using AJAX. Returned data is used to create a list of companies and price information which is current share price and change in price since last update.

The user can change the sort order of the list at any time. This does not require a server request.

Requests for updated values are made by the user clicking on the update button. You can assume that the database being accessed is being updated by some other process (which you do not have to provide).

The process by which a web site developer includes the widget into a page is as follows:

• required CSS and JavaScript files are included using and