Problem Statement
It was in 1791, where the beginnings of the New York Stock Exchange first started.
Before that, merchants and brokers would gather under a tile roof in lower Manhattan to auction
off a wide variety of commodities. During the initial 40 years the group was known as "The Royal
Exchange". Merchants and brokers primarily traded wheat, tobacco, cotton, sugar and
sometimes slaves. Selling of shares of stock of a company was not common in those days as
there were few businesses worthy of public investments in the Colonies at the time. Yet as
America continues to plunge into the depths of the Information Age, many people who have
shares of stock are not always available to keep up with the daily activity of their personal stock.
As a result, there are a growing and fairly profitable number of solutions available on
today’s market to accommodate the stockholder. Initially, the Broker would be the middleman
and inform the stockholder of their gain or loss, usually the stockholder would have to watch the
news or phone in to check up on a particular stock. This service is somewhat outdated, even with
the technology being used now, stock web pages only report the gain or loss of a stock on set
time intervals.
These services were soon made up-to-date by the growing popularity of wireless phones.
Companies could now interact with the user and provide as much or as little information as
needed about a stock a stockholder was interested in. Furthermore, without having to send
pages to selected users, more time could be spent on updating concurrent information and
providing the user with real-time access while on their wireless phone.
However, despite their relative success, all of the current solutions updating a particular
stock, seemed to have failed in realizing their full potential in terms of simplicity, usability, and
most importantly, accuracy. Some of the applications require an extensive amount of user input,
something that simply cannot be done in every mobile situation. Some applications that are
helpful in retrieving real-time stock activity are Hypertext Preprocessor (PHP) which, integrates
well with other technologies and applications.
As the name indicates, Fast Stocks provides the current stock information for stockholders.
Focusing on only the stocks that the stockholder is interested in or has invested in, Fast Stocks
effectively provides real-time information to every user. With the minimal user input of only
entering a stock name, users are free to add a stock, remove a stock, log out of the session and
get real-time information.
Technical Specifications
Code Languages
The following programming languages will be used throughout the Fast Stocks application:
PHP - PHP Hypertext Preprocessor will be the language used for all of the backend
programming for this application. PHP.net describes PHP in the following: “PHP is a
widely-used general-purpose scripting language that is especially suited for Web
development and can be embedded into HTML.” PHP is a very fast and robust multi-
platform language that integrates well with other technologies that will be used in this
application.
For more information on PHP, please visit the PHP website at http://www.php.net
WML - Wireless Markup Language will be used to create all the pages that will be
accessed by the mobile phone device. WML is the standard language used by all
wireless-enabled mobile phones, so it is only natural that it will be used in our pages.
Although many of the WML pages will be dynamically created through the PHP backend,
a few will be hand-coded.
WMLScript - Wireless Markup Language Script will be used in the creation of pages
accessed by the mobile phone device. WMLScript ties closely with WML and will allow
for greater control over WML pages by providing additional functions not included in
WML.
HTML - HyperText Markup Language will be used for the application web site. HTML is
the de facto language used for web pages, so there is very little to argue regarding is
choice. Like the WML pages, most of the HTML will be dynamically generated from a
PHP backend.
SQL - Structured Query Language will be used for all database queries. This is the de
facto language used to communicate with databases.
Hardware
The following hardware will be used by the Fast Stocks application:
Server - The application will be hosted on yellowmonkey.bsd.uchicago.edu. This is a
Ben May Institute for Cancer Research at the University of Chicago owned server. The
machine is a Sun Microsystems Sun Blade 150 Workstation running Solaris 9 operating
system, Apache 2.0.36 web server, PHP 1.3.0 and MySQL 3.23. This server was chosen
because of ease of access and configuration.
Backup Server - All of the application files will be initially backed up on the Shrike server
at DePaul University. They will also be backed up on huggins.bsd.uchicago.edu. This
should provide complete failure security.
Mobile Interface - The application will run on any web-enabled wireless phone or phone
simulator running on a desktop computer.
Software
The following software will be used in the development and testing of the Fast Stocks application:
HTML development - Macromedia Dreamweaver will be used for all HTML design and
development. This is a powerful and widely used design tool by web designers.
PHP development - PHPEdit will be used for developing PHP backend code. It is a free
IDE for PHP.
WML and miscellaneous development - TextPad 4.6 will be used for all WML and other
miscellaneous development.
Code Maintenance
All code in all languages will properly documented so that any programmer with knowledge of
WML, PHP, HTML and WMLScript will be able to easily make changes to the code in any file in
the application.
Database Maintenance
All data will be stored in a MySQL database hosted on yellowmonkey.bsd.uchicago.edu. MySQL
is a robust GNU General Public License (GPL) licensed project that has a very large web user
base. It can handle large multiple user connections and up to 255 persistent connections at one
time.
From the MySQL Documentation:
Internals and Portability
Written in C and C++. Tested with a broad range of different compilers.
Works on many different platforms.
Uses GNU Automake, Autoconf, and Libtool for portability.
APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl. See section 8 MySQL
APIs.
Fully multi-threaded using kernel threads. This means it can easily use multiple CPUs if
available.
Very fast B-tree disk tables with index compression.
A very fast thread-based memory allocation system.
Very fast joins using an optimized one-sweep multi-join.
In-memory hash tables which are used as temporary tables.
SQL functions are implemented through a highly optimized class library and should be as
fast as possible! Usually there isn't any memory allocation at all after query initialization.
The MySQL code gets tested with Purify (a commercial memory leakage detector) as
well as with Valgrind, a GPL tool (http://developer.kde.org/~sewardj/).
Scalability and Limits
Handles large databases. We are using MySQL Server with some databases that contain
50 million records and we know of users that use MySQL Server with 60,000 tables and
about 5,000,000,000 rows.
Up to 32 indexes per table are allowed. Each index may consist of 1 to 16 columns or
parts of columns. The maximum index width is 500 bytes (this may be changed when
compiling MySQL Server). An index may use a prefix of a CHAR or VARCHAR field.
Connectivity
Clients may connect to the MySQL server using TCP/IP Sockets, Unix Sockets (Unix), or
Named Pipes (NT).
ODBC (Open-DataBase-Connectivity) support for Win32 (with source). All ODBC 2.5
functions and many others. For example, you can use MS Access to connect to your
MySQL server.
Users will be allowed to register and edit their information, but the Administrator will have final
control over accounts on the system.
Database Security
MySQL provides a good deal of security; far more than any Microsoft Access database could
possibly provide. MySQL uses a user/password system with built-in one-way password
encryption.
Administration of the application database and web site will be restricted to a registered
administrator. Administrator information will be stored in the database, effectively controlling user
access to administrative parts of the site.
To prevent intentional and unintentional harmful user entries into the database, all field values will
be escaped and un-escaped upon retrieval from the database.
MySQL provides a Privilege System for all database users.
From the MySQL Documentation:
The primary function of the MySQL privilege system is to authenticate a user connecting from a
given host, and to associate that user with privileges on a database such as SELECT, INSERT,
UPDATE and DELETE.
Additional functionality includes the ability to have an anonymous user and to grant privileges for
MySQL-specific functions such as LOAD DATA INFILE and administrative operations.
The MySQL privilege system ensures that all users may do exactly the things that they are
supposed to be allowed to do. When you connect to a MySQL server, your identity is determined
by the host from which you connect and the user name you specify. The system grants privileges
according to your identity and what you want to do.
MySQL considers both your hostname and user name in identifying you because there is little
reason to assume that a given user name belongs to the same person everywhere on the
Internet. For example, the user joe who connects from office.com need not be the same person
as the user joe who connects from elsewhere.com. MySQL handles this by allowing you to
distinguish users on different hosts that happen to have the same name: you can grant joe one
set of privileges for connections from office.com, and a different set of privileges for connections
from elsewhere.com.
Please refer to http://www.mysql.com/doc/en/Privilege_system.html for more information on the
MySQL Privileges System.
Additional MySQL security information from the MySQL Documentation:
Security
A privilege and password system that is very flexible and secure, and allows host-based
verification. Passwords are secure because all password traffic is encrypted when you
connect to a server.
MySQL uses security based on Access Control Lists (ACLs) for all connections, queries,
and other operations that a user may attempt to perform. There is also some support for
SSL-encrypted connections between MySQL clients and servers. Many of the concepts
discussed here are not specific to MySQL at all; the same general ideas apply to almost
all applications.
For more information on MySQL, please visit the MySQL website at http://www.mysql.com
Level 0 Data Flow Diagram
Log in Log in
U 0 A
Authorization Authorizatoin
User Administrator
Display User Stocks
Fast Stocks
Check Stocks User Maintenance
Update User Stocks Update User Access
Level 1 Dataflow Diagram
Update User Access
1
Verify User Id
User Login
Delete User D1 User
Login Authorization
Authorization
Login
2 U
Display
Favorite User
Update User Stocks
Display User Stocks
Check Favorite Stocks
Update
Favorite Returned
Stocks Query Queried
User Stocks
Stocks
D2 Favorite
Stocks
Returned
Stock Id User Maintenance
Access
D4
Administrator
Verify
Authorization Admin
Id
Login
Query Login Authorization
Stock Id Returned
Queried
Stock Id
D3 Stocks
Modules for phone application – User (Total 8 hours)
Module: login.wml (Nick Korbel)
Object:
Time: 1 hour
Description: This will be the first page the user is given when he/she connects to FastStocks.
The user is asked for a UserId and Password in order to log into FastStocks. If the user does not
have a valid UserId and Password, then he/she will not have access to FastStocks. If the user
matches one of those in the database, then he/she is then redirected to home.wml.
Module: home.wml (Nick Korbel)
Object:
Time: 1 hour
Description: This will be the page the user is presented with once logged on. Here, the user
can navigate around FastStocks. The user can either, check his/her stocks (mystocks.wml),
check the market info (market.wml), search for specific stocks to see the current value
(search.wml), and logout of FastStocks (logout.wml).
Module: market.wml (Nick Korbel)
Object:
Time: 1 hour
Description: This page will allow the user to check what the current market information is.
Module: mystock.wml (Nick Korbel)
Object:
Time: 1 hour
Description: This page will show the user all the stocks stored in his/her profile. They will be
able to remove whatever stock(s) he/she no longer wants to view.
Module: search.wml (Nick Korbel)
Object:
Time: 3 hours
Description: This page allows the user to search for and retrieve stock information for a
desired stock symbol. It also lets the user add the found symbol to their favorites
(mystocks.wml).
Module: logout.wml (Nick Korbel)
Object:
Time: 1 hour
Description: This page will log a user out of FastStocks.
Module Design – User
Home.wml
Search.wml
Search.wml
Search.wml
Modules for website application – User (Total 8.5 hours)
Module: logon.php (Nick Korbel)
Object:
Time: 1.5 hours
Description: This page will be the login page for all users of FastStocks. Once UserId and
Password has been verified, the user is directed to his/her favorite stocks’ page (my_stocks.php).
Module: my_stocks.php (Nick Korbel)
Object:
Time: 2 hours
Description: This page is the homepage of the user. The user will be able to view and
manage his/her favorite stocks by being able to add and remove stocks.
Module: add_stock.php (Nick Korbel)
Object:
Time: 0.5 hours
Description: This file reads the stock symbol being added and determines whether the calling
file is web or phone based. It then adds the stock to the database and returns the user to the
proper place.
Module: stocks.php (Nick Korbel)
Object:
Time: 0.5 hours
Description: This file will print out stock information in HTML or WML for a given symbol.
Module: register.php (Nick Korbel)
Object:
Time: 1 hour
Description: This page will be the registration page for any web users who wants to become a
member of FastStocks.
Module: ctrlfns.php (Nick Korbel)
Object: Empty for now.
Time: 0 hours
Description: This file will provide all control functions for the backend programs, such as
database connections and navigation.
Module: output.php (Nick Korbel)
Object: Empty for now.
Time: 0 hours
Description: This file provides all the functions for producing HTML and WML output common
to all pages in the FastStocks application.
Module: functions.js (Nick Korbel)
Object: function remove(stock)
function navChangeOver(cell)
function navChangeOut(cell)
function validateForm(f)
Time: 2 hours
Description: This file contains all the JavaScript functions that will be used throughout the
FastStocks application.
Module: style.css (Nick Korbel)
Object: body {background-color:..
a {color: #104E8B}..
p { font-size: 11px}
Time: 1 hour
Description: This file is the Cascading Style Sheet for the Fast Stocks web application.
Modules for Website application – Administrator
Module: admin.php (Nick Korbel)
Object:
Time: 1.5 hours
Description: This page will be the log on page for all Administrators of FastStocks. Once
logged on, an administrator is then directed to delete.php.
Module: delete.php (Nick Korbel)
Object: Empty for now.
Time: 0 hours
Description: This page will allow an administrator to delete any user who has not logged on
for more than 90 days.
Database Design
Data Dictionary
Administrator
Description: Contains information about the administrators of FastStocks in order to keep the
database clean of users that has not logged on for more than 90 days.
Field: Id
Type: Text
Length: 10
Default Value: None
Key: Yes
Field: Password
Type: Text
Length: 20
Default Value: None
Key: No
Field: FirstName
Type: Text
Length: 20
Default Value: None
Key: No
Field: LastName
Type: Text
Length: 20
Default Value: None
Key: No
FavoriteStocks
Description: Contains the stocks of each user. If a user has not added stocks to this table, the
user will not show up.
Field: UserId
Type: Text
Length: 10
Default Value: None
Key: Yes
Field: StockId
Type: Text
Length: 6
Default Value: None
Key: Yes
Stocks
Description: Contains information about each stock; it’s stock market code, the name of the
company, and the final price at the end of the day.
Field: Code
Type: Text
Length: 6
Default Value: None
Key: Yes
Field: StockName
Type: Text
Length: 50
Default Value: None
Key: No
Field: EndOfDayPrice
Type: Number
Length: Double
Default Value: 0
Key: No
User
Description: Contains information about the users. If a user doesn’t log on for more than 90 days,
the administrator will delete that user out of the database.
Field: Id
Type: Text
Length: 15
Default Value: None
Key: Yes
Field: Password
Type: Text
Length: 20
Default Value: None
Key: No
Field: FirstName
Type: Text
Length: 20
Default Value: None
Key: No
Field: LastName
Type: Text
Length: 20
Default Value: None
Key: No
Field: LogOnDate
Type: Date/Time
Length: Short Date
Default Value: None
Key: No