Online Bookstore: Design Document of Assignment #2
Online Bookstore: Design Document of Assignment #2
Online Bookstore: Design Document of Assignment #2
Online Bookstore
Qingfeng Duan
Qunzhang Li
Jiaye Zhou
CONTENTS
1. Introduction ------------------------------------------------------------------ 1
2. Architecture ------------------------------------------------------------------ 1
3. Features ----------------------------------------------------------------------- 1
4. How to Run ------------------------------------------------------------------ 2
5. Database Design ------------------------------------------------------------ 3
6. Directory Structure --------------------------------------------------------- 6
7. Java Servlet / JavaScript Code -------------------------------------------- 7
CS 591 / Spring 2002 - Design Document of Assignment #2 1
1. Introduction
2. Architecture
This project is developed as a web application. The web server is Tomcat version 3.3.
Tomcat supports Java Servlet and Java Server Pages (JSP). We use Java Servlets in our
development. We use MySQL database to store the book information, user account and
order information. Mark Matthew's JDBC driver mm.mysql-2.0.4-bin.jar is used
to connect Tomcat and MySQL.
mm
Tomcat JDBC MySQL
Browser
3.3 Driver 3.23.41
2.0.4
3. Features
We use Cascade Style Sheet (CSS) and JavaScript to realize the dynamic HTML feature.
JavaScript is used to validate form items such as email address and credit card
information. All items are checked by JavaScript before submitted to the web server. If
some items are not correctly filled, the application will ask the user to enter them again.
One interesting thing is the validation of credit card number. Our program can check
whether a credit card number is valid or not.
We provide a simple search engine to the user. The user can search a book from our
catalog. The supported search keys are book title, ISBN, author's last name and author's
first name. The search engine also supports the pattern-matching search. A user can input
partial information about the book and do not need to do an exact match searching.
CS 591 / Spring 2002 - Design Document of Assignment #2 2
3.3 Personalization
The user could open and update her/his account to store basic information. The
information include email address, first name, last name, shipping address, phone, billing
address, credit card brand, credit card number and expiration date of the credit card. A
returned customer does not need to enter this information when does checking out. The
program will get the data from the database and fill the form automatically. If a returned
customer wants to update some items, she or he can input those items and submit to the
database.
Another personalization is that when a returned customer logins in from the same
computer, which she or he used to visit our web store before, the program will provide
some recommendations based on her or his former shopping activities. We do this by
storing cookies in the customer computer.
We use MySQL database to store the book catalog, user account and order information.
Please refer to the section 5 "Database Design" for detail.
4. How to Run
5. Database Design
It seems that we need five tables: Three entity tables, two relationship tables.
... orderID
email ...
1 *
account account_orderInfo orderInfo
orderInfo_book
NOTE: In MySQL, *
Table names and database names are CASE SENSITIVE!!!
book
bookID ...
email
orderID bookID
orderID
password bookID
fstName email orderDate author_fstName
lastName orderID shippingType author_lastName
shippingAddress1 shippingFee title
shippingAddress2 totalFee ISBN
shippingCity status price
shippingState year
shippingZip availability
phone
category
cardBrand
cardNumber description
cardExpDate company
card_fstName
card_lastName
billingAddress1
billingAddress2
billingCity
billingState
billingZip
CS 591 / Spring 2002 - Design Document of Assignment #2 4
6. Directory Structure
index.html
META-INF MANIFEST.MF
images
*.jpg
*.gif
1group
utils.js
jsutils checkCard.js
validate.js
web.xml
BookDetailServlet.java
CashierServlet.java
CatalogServlet.java
WEB-INF Contact.java
Default.java
DialogServlet.java
Help.java
Left.java
classes Login.java
Main.java
ReceiptServlet.java
Right.java
SearchServlet.java
ShowCartServlet.java
Top.java
ViewAccountServlet.java
myCalendar.java
ShoppingCart.java
cart
ShoppingCartItem.java
BookDB.java
database
BookDetails.java
CS 591 / Spring 2002 - Design Document of Assignment #2 7
7.1 Servlets
♦ Default.java
♦ Top.java
♦ Left.java
♦ Right.java
♦ Main.java
♦ Login.java
♦ ViewAccountServlet.java
♦ Help.java
♦ Contact.java
♦ SearchServlet.java
♦ DialogServlet.java
♦ CatalogServlet.java
♦ BookDetailServlet.java
♦ ShowCartServlet.java
♦ CashierServlet.java
♦ ReceiptServlet.java
♦ myCalendar.java
♦ ShoppingCart.java
♦ ShoppingCartItem.java
♦ BookDB.java
♦ BookDetails.java
7.3 JavaScript
♦ checkCard.js
♦ validate.js
♦ utils.js