Shopping cart Project in JAVA 2EE web based

23
Shopping cart Project M30CDE Assignment 2010-2011 Development of a Java EE e-Commerce Application For the project files please contact me [email protected] Name : Saud Abdullah Aljaloud 1

description

This is an e-commerce application that will enable customers to shop online and also provide an administrative interface which will allow members of staff to keep track of customers’ orders. The application must have following minimum functionalities.• Display Items for customers.• Allows customers to add items to a shopping cart.• Allow removal of items from the shopping cart.• Update item quantities in the shopping cart as customer add item in cart.• Customers can view a summary of all items and quantities in the shopping cart.• Enable a customer to place an order and make payment providing credit card details.• Administrative interface is required to allow staff to view and tracks customers order.for the project files contact me [email protected]

Transcript of Shopping cart Project in JAVA 2EE web based

Page 1: Shopping cart Project in JAVA 2EE web based

Shopping cart Project

M30CDE Assignment 2010-2011

Development of a Java EE e-Commerce Application

For the project files please contact me

[email protected]

Name : Saud Abdullah Aljaloud

1

Page 2: Shopping cart Project in JAVA 2EE web based

Document InformationModule code and Title M30CDE Open System Application Development

Submitted by Saud Lecturer Dr. Nazaraf Shah

Document Description

Name Version

Saud 1.0

2

Page 3: Shopping cart Project in JAVA 2EE web based

ContentsDocument Information................................................................................................................................2

Introduction.................................................................................................................................................3

Purpose...................................................................................................................................................3

System Overview.........................................................................................................................................4

description of the application associated use case scenarios..................................................................4

Description:.........................................................................................................................................4

Use case diagram.....................................................................................................................................5

Overview Design of the application.............................................................................................................6

ER diagram...............................................................................................................................................6

Design class diagram...............................................................................................................................8

3

Page 4: Shopping cart Project in JAVA 2EE web based

Introduction

PurposeThis software design document describes the architecture and system design of the hospital security system done as part of M27CDE – Software Design 2011.

4

Page 5: Shopping cart Project in JAVA 2EE web based

System Overview

Description of the application associated use case scenarios

Description:This is an e-commerce application that will enable customers to shop online and also provide an administrative interface which will allow members of staff to keep track of customers’ orders. The application must have following minimum functionalities.

• Display Items for customers.

• Allows customers to add items to a shopping cart.

• Allow removal of items from the shopping cart.

• Update item quantities in the shopping cart as customer add item in cart.

• Customers can view a summary of all items and quantities in the shopping cart.

• Enable a customer to place an order and make payment providing credit card details.

• Administrative interface is required to allow staff to view and tracks customers order.

There are two main actors in the system; User and staff. Staffs are the super user of the system. He is responsible for administrative activities of the system. Updating the product lists and processing the user orders are the main responsibility of the staff. In addition he can add different categories to the system. Users are normal users of the system they can view the products lists by category, add items to their shopping cart, remove some/all of the items in the shopping cart, view the summery of the items selected, place order and make payment through the payment gateway.

5

Page 6: Shopping cart Project in JAVA 2EE web based

Use case diagramThis diagram explains about the various actions performed by the two actors.

login

logOut

view Customer Orders

add Product

add Category

Staff

display Customer Orders

list Products

user

make payment

add Items

removeItems

manage shopping cart

view summery

6

Page 7: Shopping cart Project in JAVA 2EE web based

Overview Design of the application

ER diagram

7

Page 8: Shopping cart Project in JAVA 2EE web based

Design class diagram.

CategoryDataAccess

OrderDataAccess

ProductDataAccess

UserDataAccess

DataBaseConnector

AddCategoryServlet

AddProductServlet

AddToCartServlet

AdminLoginServlet

CloseOrderServlet

LoginServlet

LogoutServlet

OrderBean

MakePaymentServlet

PaymentBean

PopulateProdutsServlet

PopulateSubcategoryServlet

RemoveCartItemServlet

ShowAddCatregoryServlet

ShowAddProductServlet

ShowOnlineShopeServlet

CategoryBean

ShowOrderDetailsServlet

OrderDetaisBean

ShowPaymentFormServlet

ProductDetailsBean

UserRegistrationServlet

UserBean

8

Page 9: Shopping cart Project in JAVA 2EE web based

This e-shopping software is designed in client server model. The sever side of this software uses JSP, Servlets and java bean class [ J2EE frame work]; the database used is mySql. The clients /staff can access through web browser which is java enabled. JSP is used for the user interface creation for the dynamic pages, but this will be converted to plain html and sent to the client machine.

Model-view-Controller pattern is used for the design. This gives modularity and low coupling to the design. The changes in one layer will not affect the other layers in the system. I.e., Changes in user will affect only userBean of model layer. All the servlets belongs to Controller layer of this design. This will perform request parsing first; in the second step it will create corresponding model class /classes to perform the business logic; and at the last it will forward the control to view class with the result.

JSP [java Server Page] files forms the view layer of this design. These files will generate dynamic html with the result values forwarded by the controller Servlets. View layer is the presentation Layer in the design. This will have the user interface to interact with the End Users of the system. JSP tags will be embedded in html pages and while execution these tags will be converted to servlets.

Model layer does the business logic of this software. A number of Java bean classes build this layer. In this design model layer is again split into tree sub layers for more modularity. The first layer consist of entity classes , the second layer consists of DB access classes and the third layer id the Database Connector class. All the database connection related information is isolated to the third Layer, this kind of a design makes it easy to change from one software vendor to other. And only one class need to be modified for this. Access lasses will have sql queries for the data manipulation from the database. This layer will help in realizing the entity classes. Entity calluses will perform the core business logic through its methods with the help of Data Access Layer.

9

Page 10: Shopping cart Project in JAVA 2EE web based

Task Description1.TASK

New User Registration

SUBTASKGet details from user as follows

UserId Password First Name Last Name Email Country Zip State City Address Phone Fax

TESTCASE UserId should not be left blank and should be less than or equal to 30 characters Password should not be left blank and should be less than or equal to 30

characters First Name should not be left blank and should be less than or equal to 30

characters Last Name should not be left blank and should be less than or equal to 30

characters Email should not be left blank and should be less than or equal to 30 characters Country should not be left blank and should be less than or equal to 30 characters Zip should not be left blank and should be less than or equal to 30 characters State should not be left blank and should be less than or equal to 30 characters City should not be left blank and should be less than or equal to 30 characters Address should not be left blank and should be less than or equal to 30 characters Phone should not be left blank and should be less than or equal to 30 characters Fax should be less than or equal to 11 characters

EXPECTED RESULT

10

Page 11: Shopping cart Project in JAVA 2EE web based

The UsedId and Password should be saved in the database along with all the Personal information entered during registration.

REMARKNew User Registration Successful

TEST RESULTThe UserId, Password and the personal information of the new user is saved in the

database successfully.

2.TASKUser Login

TESTCASE UserId : Use UserId registered during New User Registration. Password as per user registration.

EXPECTED RESULTLog in to Shopping Cart Welcome Page

REMARKLogin Successful for Registered user

TEST RESULTLog in using the registered UserId and Password is successful.

3.TASKAdd items to Cart (Online Shopping)

SUBTASK Select a Category

o Select a Sub Category

o Add items to Cart

Add more than one item Remove item from cart

11

Page 12: Shopping cart Project in JAVA 2EE web based

TESTCASE Item Category has to be selected before going for sub-category.

EXPECTED RESULT

The desired item has to be listed in cart properly when added to cart and when more than one item is added to cart, the total price has to be the sum of prices of the items in the cart.

When an item is removed from cart, the price of the item should be reduced from the total price.

REMARKThe items selected are successfully added to cart.The item is removed successfully as required.

TEST RESULTSub Categories are listed properly under corresponding Categories.Items added are displayed in cart and total price is displayed as sum of prices of the items

in cart. When an item is removed from cart, the total price is getting reduced to the total price of

items present in cart.

4.TASKCheckout the items in cart and Place order

SUBTASK Select credit Card Type Enter Credit Card Number Enter Credit Card Expiry Date Enter Card Holder Name Enter CVV number Enter customer Notes, if any

TESTCASE A valid Credit Card Type has to be selected Credit Card number has to be entered in less than or equal to 20 characters

12

Page 13: Shopping cart Project in JAVA 2EE web based

Credit Card Expiry Date has to be entered in date format (YYYY MM) Credit Card Holder Name has to be entered in less than or equal to 30 characters CVV number has to be entered in less than or equal to 11 numbers Customer note can be entered in less than or equal to 255 characters

EXPECTED RESULTThe items added to cart has to be shown in the cart shown in the page and the order

should be placed after successful validation of the credit card details.

REMARKOrder Placed Successfully.

TEST RESULTThe selected items were shown in the check out window and the order is placed

successfully after the validation of Credit card Details.

5.TASKAdministrative Login

SUBTASK Login to admin account View orders placed by customers View detailed information regarding orders placed by customers

TESTCASEThe admin user name has to be entered in the Login ID field and respective password has

to be entered.

EXPECTED RESULT Should enable you to view the orders placed by customers Should get detailed information regarding the orders placed

REMARKLogin in to administrative account successful.

TEST RESULTSuccessfully logged into administrative account after providing valid login ID and

password.

13

Page 14: Shopping cart Project in JAVA 2EE web based

The orders placed by customers are displayed accurately and detailed information regarding the orders is successfully displayed.

6.TASKCheckout the orders placed by customers.

TESTCASEThere should be at least one order placed by a customer.

EXPECTED RESULTThe order should be checked out and the pending order list has to be cleared.

REMARKSuccessfully checked out.

TEST RESULTThe order placed by customer is successfully checked out.

Evidence of implementation

Screen shots

USER LOGIN PAGE (INDEX)

NEW USER REGISTRATION

14

Page 15: Shopping cart Project in JAVA 2EE web based

REGISTRATION SUCCESSFUL

USER LOGGED IN

ONLINE SHOPPING WINDOW

15

Page 16: Shopping cart Project in JAVA 2EE web based

CHECK OUT WINDOW

ORDER PLACED SUCCESSFULY

16

Page 17: Shopping cart Project in JAVA 2EE web based

ADMIN LOGIN PAGE

ADMIN PAGE

ADMIN PAGE DETAILED VIEW

17

Page 18: Shopping cart Project in JAVA 2EE web based

PRODUCT CHECKED OUT

ADD CATEGORY WINDOW

18

Page 19: Shopping cart Project in JAVA 2EE web based

ADD PRODUCTS WINDOW

19