Assignment one -> Task three
 

Task three: Web shop

Introduction

A computer shop wants to sell its articles on the internet. Selling online has a number of advantages over selling by conventional methods, including (http://www.businesslink.gov.uk):

  • Making savings in set-up and operational costs. You don't need to pay shop assistants, rent high-street premises, or answer a lot of pre-sales queries.
  • Reducing order-processing costs - customer orders can automatically come straight into your orders database from the website.
  • Reaching a global audience, thereby increasing sales opportunities.
  • Competing with larger businesses by being able to open 24 hours a day, seven days a week. Being able to receive payment more quickly from online transactions.
  • Attracting customers who would not normally have investigated your type of high-street outlet.
  • Improving your offerings using the data gathered by tracking customer purchases.
  • Using your online shop as a catalogue for existing customers.

Requirements

We get the assignment to build a small piece of the webshop. We have to build a register page in which the users of the webshop can register themselves with a name a password. We have to build the catalog page, so the users can see the articles which they can buy and the possibility to add articles to a shopping cart.

The architecture of the system has to be multi-tier; the clients use a web browser, the application is running on a glassfish application server and the database on a MySQL server.

The database is provided by a webshop.sql file containing the create table and the insert statements and an ERD document containing the ERD diagram of the database.

Goal state

Using goal state gives an idea about the functionality and interfaces of how the final product should look like.

Solution

We use two Servlets. The first Servlet, the Login Servlet starts a HTTPsession and shows the register page to the user. After the user has been registred the login servlet passes the control to the ControlServlet. The source code of the login Servlet is given in the Login document.

For the cart bean, we have to make use of a stateful session bean because each user has its own shopping cart.

Finish, this application by yourself.

© Marco Marcellis 2009