a Study in Using E-Commerce to Facilitate On-Line Auctions at an Institutional Level

a Study in Using E-Commerce to Facilitate On-Line Auctions at an Institutional Level

R.E.X. (Rhodes E-commerce eXchange)

- A Study in Using E-commerce to Facilitate On-line Auctions at an Institutional Level.

Submitted in partial fulfilment

of the requirements of the degree

Bachelor of Science (Honours)

of Rhodes University

by Roché Naudé

Computer Science Department

November 2001

Acknowledgements

My supervisors- Mr. John Ebden for making sure that I was on track with my proposal and providing crucial SQL problem solving tips, and Dr. George Wells for endless practical advice on doing the project effectively and Java™ ‘guidance’ and encouragement in my battles with the web server.

My mom just for being super and SO supportive, especially during moments of crisis- thanks for carting all those cups of coffee my way!

Susie Radloff for being a best friend- faithful in prayer and encouragement!

My Dad for his encouraging feedback and interest in my project and website.

Paul Sainsbury for persistently telling me that I can do it, in the face of my ‘but I can’t do it’ arguments.

I love reading, and I think that every book I’ve ever read has had a dedication of some form or other on the first page. So this is where I get to dedicate something written! To God, for everything, and particularly for showing me that there is life beyond the lab and that hard work still means something.

Conventions and Copyright Notices

Code extracts used in this report are formatted as, or as a variation of, the following:

this is code.

Sun, Sun Microsystems, the Sun Logo, iPlanet™ FastTrack Web Server, Java™, Java™ Servlet, JavaServer Pages™, JDBC™, JavaBeans™, JDK™, JRE™, Enterprise JavaBeans™, JavaMail™, JavaBeans™ Activation Frameworkare trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.

Borland, the Borland Logo, InterBase®, InterClient™ are trademarks or registered trademarks of Borland Software Corporation in the United States and other countries.

Microsoft Internet Explorer®, Microsoft Windows 2000® and XP®, Microsoft FrontPage® and any other Microsoft affiliated product and logos are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

UltraEdit® is a registered trademark of IDM Computer Solutions, Inc., All rights reserved.

R.E.X.

The implementation of the auction based e-commerce system discussed in this report using Java related technologies.

Copyright (C) 2001, R. Naudé.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Copyright © 2001. R. Naudé, All Rights Reserved.

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice, as well as the above stated notices, are preserved on all copies, and provided that the recipient is not asked to waive or limit his right to redistribute copies as allowed by this permission notice.

Permission is granted to copy and distribute modified versions of all or part of this manual or translations into another language, under the conditions above, with the additional requirement that the entire modified work must be covered by a permission notice identical to this permission notice.

Abstract

In light of the success of some of the mass-market on-line e-commerce (particularly auction based) sites such as ebay.com, this project investigates the viability and implementation issues associated with such a site developed at an institutional level using Java technologies.

The system investigated consisted of a web-based application modelled on the three-tier client-server architecture using free and low-cost software. Technologies used and investigated include Java, JSP, servlets and JDBC. The implementation part of the project resulted in a rudimentary proof of concept system proving the viability of an affordable, dynamic, small to medium scaled, Java based e-commerce endeavour.

Table of Contents

Chapter 1:Introduction

1.1Background

1.2The Project

1.2.1Motivation

1.2.2Description

1.2.3Scope

1.2.4Deliverables

1.3The Three-tiered Client-Server Approach

1.4Technologies Used

1.5Overview of the Report

Chapter 2:The E-commerce Environment

2.1Why Three Tiers?

2.2The Major Development and Deployment Options

2.2.1Java vs. Microsoft®.NET

2.2.2Why Java?

2.3Java

2.4JavaScript

2.5Servlets

2.6JavaServer Pages(JSP) and JavaBeans

2.7JavaMail

2.8Java Database Connectivity (JDBC)

Chapter 3:The Front-end (First Tier)

3.1The Thin Client Approach

3.1.1Thin Client vs. Thick Client

3.1.2Applets vs. Form Elements

3.2Technologies Used in the R.E.X. Front-end

3.2.1Browser

3.2.2JavaScript

3.3Front-end Features

3.3.1Design

3.3.2Performance

3.3.3Maintenance

Chapter 4:Business-Application Logic (Middle-Tier)

4.1The Functionality and Responsibilities of the Middle-Tier

4.1.1Session Tracking

4.2Technologies Used in the R.E.X. Middle-Tier

4.2.1The Web Server

4.2.2iPlanet FastTrack Web Server

4.3The Advantages of Servlets over Common Gateway Interface (CGI)

4.4The Advantages of JavaServer Pages

4.4.1Over ASP

4.4.2Over PHP

4.4.3Over JavaScript

4.4.4Over Static HTML

4.5Servlets and JavaServer Pages

4.5.1Servlets vs. JavaServer Pages

4.5.2Using Servlets and JavaServer Pages Together

4.6JavaServer Pages and JavaBeans

4.7JavaMail

4.8Middle-Tier Features

4.8.1Design

4.8.2Performance

4.8.3Maintenance

4.8.4Scalability of Business Side Objects......

Chapter 5:The Back-end (The Database Server)

5.1The Services Provided by the Database Tier

5.1.1The Relational SQL Database

5.1.2Borland InterBase

5.2JDBC as an Interface to the Database Tier

5.2.1Using JDBC

5.2.2Statement vs. PreparedStatement

5.3Advantages and Disadvantages of using Pure JDBC

5.4Back-end Features

5.4.1Design

5.4.2Performance

5.4.3Maintenance

Chapter 6:The Practical Implementation of R.E.X.

6.1The R.E.X. Architecture

6.1.1 Client-side (Remote User’s Computer)

6.1.2 Middle-tier (Middleware/Communications)

6.1.3 Database Server

6.2The Interaction Between the Three Tiers

6.3Implementation Benefits

6.3.1JavaBeans and JavaServer Pages

6.4Implementation Problems

6.4.1Web Server Specific Problems

6.4.2Database Server Specific Problems

6.5Using the Prototype

6.6Testing the Prototype

6.7Scalability and Practical Full-scale Implementation Considerations of R.E.X.

6.8Conclusions

Chapter 7:Conclusion

7.1Overview

7.2Future Directions

7.2.1Security

7.2.2Payment Options

References

Appendix A

R.E.X. File Hierarchy

A Look at R.E.X.

Practical Set-up of R.E.X. on Windows 2000

Appendix B – Overview of Software Used

Appendix C

Contents of the CD-ROM

Appendix D

Bibliography

Glossary

Project Poster

Figures

Figure 11: Three-tiered Client-Server Architecture

Figure 31: Thin and Thick Client Components [Computing Alternatives, 2000]

Figure 32: HTML Form Elements Example

Figure 33: JavaScript Example

Figure 51: JDBC Facilitated Communication

Figure 61: The R.E.X. Architecture (adapted from [Gupta, 2001])

Figure 62: The R.E.X. Database Table Schema

Tables

Table 21: Three-tier Architecture vs. N tier Architecture

Table 22: J2EE and Microsoft.NET Compared

Table 41: Advantages and Disadvantages of iPlanet FastTrack Web Server

Table 51: InterBase Features

Table 52: The JDBC Package

Chapter 1:Introduction

1.1Background

More and more people are gaining access to the Internet and the information and services that it provides. Electronic commerce (e-commerce) is growing daily [Allamaraju et al, 2001] due largely to the benefits associated with the Internet such as:

  • Easy accessibility - all the consumer needs is a computer, a modem and a phone-line
  • Twenty-four hour access
  • The delivery of goods to the consumer’s door
  • On-line credit/debit payment options
  • The freedom of shopping from the comfort of the consumer’s own home, at the consumer’s convenience, with little physical exertion or time-wastage on queues, persistent salespeople, traffic, parking and carrying shopping bags.

As a result of this growth, on-line shopping and trade ventures are expanding into more user-friendly and participative areas, including auction type exchanges. An example of this functional evolution is Amazon.com [Amazon, 2001] which is now incorporating auction and second-hand sales along with its central book selling concern .

Successful on-line stores are usually large-scale commercial endeavours. The author will attempt to show that the implementation of such a system outside the arena of well-known large-scale e-commerce businesses such as ebay.com™ [eBay, 2001] is feasible, beneficial and practically achievable.

1.2The Project

1.2.1Motivation

The motivation for this project is perhaps best clarified with a practical example. When a department at Rhodes University closes down there are many practical issues that need to be addressed. One of these issues is how to dispose of equipment and furniture that will no longer be used. The obvious solution would be to sell the equipment to interested parties, but in order to do that, the interested parties would need to be told about the sale of the goods. The question then, is how can a seller effectively let prospective buyers know about goods? Students in ‘digs’ (off-campus student housing) have a similar problem. When they leave Grahamstown, hopefully with degree in hand, they often need to sell furniture that they will not be using anymore or textbooks that they have finished with. The usual method of advertising such goods is via notices pinned up in a variety of places around campus. This is impractical and not cost effective. Most goods advertised in this way are sold when a prospective buyer ‘happens’ to see the notice as he or she wanders by.

A solution to this problem would be a central repository of second-hand goods for sale that is accessible to all people interested in buying these goods. The classifieds section of newspapers have been utilising this approach for years. If a person is looking for something second-hand, then their first point of reference is usually the classifieds.

All students at Rhodes University have access to the Internet. If a central repository of second-hand auction goods could be provided on the Internet then prospective buyers and sellers would simply have to sit at a computer and access this central repository, via a web browser.

1.2.2Description

This project has two primary objectives. The first is an investigation into the development of an affordable, dynamic, small to medium scaled web-based auction endeavour specifically for use at an institutional level, such as Rhodes University. This investigation focuses primarily on the Java related technologies that can be used to accomplish such a development.

The second objective results from the outcome of the investigation in the first objective- namely the production of a small to medium scaled e-commerce application prototype that could be implemented for use by the staff, administration and students of Rhodes University. This system provides information about, and facilitates, the auction of products ranging from books to desks and sporting equipment. Clients interact with the system using an interface accessible via the Internet. They can register with the system which results in the creation of their own user account. This user account facilitates all their other interactions with the system such as bidding, auctioning and so on. The prototype system will from hereon be referred to as R.E.X., an acronym for Rhodes E-commerce eXchange.

1.2.3Scope

The author wishes to reiterate that the main focus of this project is an investigation into the use of Java related technologies in the development of a small to medium-scaled e-commerce endeavour. It has not been the author’s intention to focus in any great detail on security issues or payment options relevant to a system such as R.E.X. At a reasonably small university, such as Rhodes, payment and delivery options are not a major concern as people who use R.E.X. could conveniently meet on campus to make payment and delivery arrangements. Much of e-commerce security deals with credit card payments and the secure transfer of the information associated with these transactions. While these issues, particularly security, are important they fall outside the scope of this project and have not been addressed explicitly except as possible future extensions to this project.

1.2.4Deliverables

This project has resulted in this investigative report and in R.E.X. - a rudimentary practical system demonstrating the results of the investigation in this report.

1.3The Three-tiered Client-Server Approach

Figure 11: Three-tiered Client-Server Architecture

Figure 1-1 represents a high-level model of the three-tiered client-server (request-response) architecture investigated in this report and used in the implementation of the R.E.X. On-line Auction system prototype. The author has chosen a three-tiered rather than a two-tiered approach as this facilitates a clear logical separation of the components comprising the system. The functional separation is as follows:

  1. The front-end handles client interaction. This is the part of the system with which the end-user interacts.
  2. The middle-tier  handles the business application logic of the system. It services client requests by taking the appropriate action, such as passing requests on to the database server. It also manages the presentation of the responses to client requests.
  3. The back-end handles persistent data. It is composed of a database server which houses the R.E.X. database.

The three-tiers illustrated, and the associated implementation/investigative decisions made concerning these layers, are discussed in greater detail in chapters 3, 4, 5 and 6.

1.4Technologies Used

It is assumed that the reader of this report has at least a basic understanding and knowledge of Java as an object-oriented programming language, the Hypertext Mark-up Language (HTML) and the Structured Query Language (SQL).

The Java technologies used in R.E.X. will be discussed and defined briefly in chapter 2 “The E-commerce Environment” and more specifically in chapters 3, 4, 5 and 6 which discuss the system tier by tier and the practical implementation of R.E.X.

The technologies used and investigated are listed here for reference:

  1. Java
  2. JavaScript
  3. Servlets
  4. JavaServer Pages (JSP) and JavaBeans
  5. JavaMail
  6. Java Database Connectivity (JDBC)

1.5Overview of the Report

Chapter 2 “The E-commerce Environment” explores the development and deployment issues relevant to the production of an e-commerce system with particular emphasis on, and definitions of, Java related technologies in this field.

The first tier of a three-tiered client-server architecture is defined and discussed in detail in Chapter 3 “The Front-end (First Tier)”. Similarly, Chapter 4 “Business-Application Logic (Middle-Tier)” looks at the middle-tier of the architecture and Chapter 5 “The Back-end (The Database Server)” investigates the database tier of the system.

Chapter 6 “The Practical Implementation of R.E.X.” examines the practical issues involved in the design and implementation of the prototype in light of the tier by tier discussions in chapters 3, 4 and 5.

Chapter 7 “Conclusion” concludes the report and shows future directions and possible extensions to this project.

The references used in the report are followed by Appendix A. This details the R.E.X. prototype file hierarchy and gives a walk through of the system using a combination of descriptions and screen dumps of R.E.X. in action. Readers interested in using the R.E.X. implementation can utilise the instructions provided in a “Practical Set-up of R.E.X. on Windows 2000”, page 98. This is followed by Appendix B which gives URLs to documents highlighting the general features of the software used by R.E.X.:

  • iPlanet (Sun Netscape® alliance) FastTrack web server
  • InterBase Database server
  • InterClient JDBC driver and InterServer

Appendix C lists the contents of the CD included with this report and Appendix D gives the report Bibliography and Glossary. Finally, the project poster is provided in A3 format at the end of this report.

Chapter 2:The E-commerce Environment

The e-commerce environment can be divided into two categories:

  1. The environment in which an e-commerce application is developed.
  2. The environment in which an e-commerce application can be, and is, deployed.

This chapter focuses primarily on the environment in which an e-commerce application is developed. This environment consists of the tools, methods and APIs used in designing and coding a system. The deployment environment, on the other hand, refers to the environment in which a system operates and is used.

2.1Why Three Tiers?

A tier can be thought of as a layer defined by its function and/or location. It is composed of similarly organised objects that help it fulfil its function [whatis?com, 2001].

A three-tiered system is a type of client-server architecture composed of three distinctly defined processes- a user interface, a business-logic layer and a database layer. Each of these tiers can run on a different machine or platform [Webopedia, 2001]. For example, the front-end handles client interaction and is located on the user’s machine while the middle-tier is located on a server and manages business processing.

With the advent of distributed computing, the Internet and large-scale e-commerce endeavours, the standard one, two or three-tiered architecture now has the potential to expand into multiple tiers (n-tiers). The middle-tier (server-side) is particularly vulnerable to layer multiplication because the developer may be tempted to create a new, or separate, layer for every separate business function or application. For example, creating a separate physical and/or logical layer for registering a user, for bidding on goods etc.

The developer must choose the architecture that best meets the needs of the specific system in development [Allamaraju et al, 2001]. This choice involves carefully considering both the advantages and disadvantages of a specific architecture in terms of the particular system that is being developed.

In the three-tier architecture the modification or replacement of a single tier, without influencing or affecting the other tiers, is simplified because of the functional modularity provided by the high-level definition of each of the three tiers [Webopedia, 2001].

Chaffee, 2000 summarises the pros and cons of three and n-tiered architectures in the following table:

Architecture / Pros / Cons
Three tiers /
  • Can separate user interface, logic and storage
  • Reliable, replicable data
  • Concurrent data access via transactions
  • Efficient data access
/
  • Need to buy database product
  • Need to hire database administrator
  • Need to learn new language (SQL)
  • Object-relational mapping is difficult

N tiers /
  • Support multiple applications more easily
  • Common protocol/API
/
  • Quite inefficient
  • Must learn API (CORBA, RMI, etc.)
  • Expensive products
  • More complex; thus, more potential for bugs
  • Harder to balance loads

Table 21: Three-tier Architecture vs. N tier Architecture

One and two-tier architectures will not be discussed in great detail because an e-commerce site such as R.E.X. relies on a database tier for persistent data storage. A two-tiered architecture consists of a client, a server and the protocol through which the two communicate. It does not explicitly define a storage tier and relies on the developer to build one into the server tier if needed [Chaffee, 2000].