Вы находитесь на странице: 1из 87

THE DESIGN AND IMPLEMENTATION OF

ONLINE SHOPPING CART

BY

ONAYEMI YUSUF ADEWALE


MATRIC NO; NOU100211093
Agidingbi, Ikeja Study Centre

Submitted to
Department of Computer Science
School of Science and Technology
National Open University of Nigeria

OCTOBER, 2014

i
Table of Contents
DECLARATION.......................................................................................................................................vi
CERTIFICATION.....................................................................................................................................vii
DEDICATION........................................................................................................................................viii
ACKNOWLEDGEMENT...........................................................................................................................ix
Abstract.................................................................................................................................................x
CHAPTER 1.............................................................................................................................................1
1.0 Introduction...........................................................................................................................1
1.1 Problem.................................................................................................................................3
1.2 Revenue Model......................................................................................................................3
1.3 Aim and Objectives................................................................................................................4
CHAPTER 2.............................................................................................................................................6
2.0 Literature Review...................................................................................................................6
2.1 History of E-commerce..........................................................................................................6
2.1.1 International E-Commerce statistics..............................................................................7
2.1.2 Customers......................................................................................................................7
2.1.3 Logistics.........................................................................................................................8
2.1.4 Payment.........................................................................................................................8
2.1.5 Product delivery.............................................................................................................9
2.1.6 Shopping cart systems.................................................................................................10
2.1.7 Online gift shops..........................................................................................................10
2.1.8 Design..........................................................................................................................10
2.1.9 Information load..........................................................................................................10
2.1.10 Consumer needs and expectations..............................................................................11
2.1.11 User Interface..............................................................................................................12
2.1.12 Market Share...............................................................................................................12
2.2 Advantages and disadvantages of E-commerce...................................................................12
2.2.1 Advantages of E-commerce.........................................................................................12
2.2.2 Disadvantages of E-Commerce...........................................................................................14
2.2.3 Product Suitability........................................................................................................16
2.2.4 Aggregation..................................................................................................................17
2.2.5 Impact of reviews on consumer behaviour..................................................................17
CHAPTER 3...........................................................................................................................................19
ii
3.0 Project Design......................................................................................................................19
3.1 Data Model..........................................................................................................................19
3.2 Database Design..................................................................................................................21
3.3 Process Model.....................................................................................................................23
3.3.1 Functional Decomposition Diagram.............................................................................24
3.3.2 Data Flow Diagram (DFD).............................................................................................25
CHAPTER 4...........................................................................................................................................31
4.0 User Interface Design...........................................................................................................31
4.1. Implementation Technologies.............................................................................................31
4.2. Internet Information Services (IIS).......................................................................................31
4.3. ASP.NET...............................................................................................................................32
4.3.1. Authentication in ASP.NET...........................................................................................33
4.4. MySQL Database..................................................................................................................33
4.5. Integrating IIS and ASP.NET.................................................................................................34
4.6 Integrating the Website and Database................................................................................35
4.7 Web Page Programming Options........................................................................................36
4.7.1. Server-side processing.................................................................................................37
4.7.2. Client-Side Processing..................................................................................................40
4.8 Web Based Application Development.................................................................................41
4.9 Database Connectivity.........................................................................................................43
4.9.1 ADO.NET.....................................................................................................................43
4.9.2 Connecting ASP.NET application to a Database...........................................................48
4.10 The Shopping Cart Application.........................................................................................50
4.10.1 Search for Books..........................................................................................................51
4.10.2 Registration..................................................................................................................51
4.10.3 User Details..................................................................................................................51
4.10.4 Shopping Cart...............................................................................................................52
4.10.5. Place an Order.............................................................................................................52
4.10.6. Check Out........................................................................................................................52
4.10.7. Purchase History.........................................................................................................53
4.10.8 Transactions in the Application...................................................................................54
4.11 Limitations and Future Development..................................................................................57
CHAPTER 5...........................................................................................................................................58
5.0 Summary of Result.....................................................................................................................58
iii
5.1 Conclusion...........................................................................................................................59
5.2 Recommendation................................................................................................................60
Reference............................................................................................................................................61
Appendix.............................................................................................................................................65
Appendix 1.......................................................................................................................................65
Appendix 2.......................................................................................................................................69

iv
Table of Figures
Figure 1 Entity Relationship Diagram (ERD)......................................................................................20
Figure 2 Functional Decomposition Diagram......................................................................................24
Figure 3 Customer - Browse Context DFD..........................................................................................25
Figure 4 Customer Browse Detailed DFD.......................................................................................26
Figure 5 Customer – Shopping Cart Context DFD..............................................................................26
Figure 6 Customer - Shopping Cart Detailed DFD..............................................................................26
Figure 7 Customer - Shopping Cart Detailed DFD.........................................................................27
Figure 8 Customer - Shopping Cart Detailed DFD..............................................................................27
Figure 9 Customer – Authentication – User Profile DFD....................................................................27
Figure 10 Authenticated User-Purchase Context DFD........................................................................28
Figure 11 Customer - Authentication - Purchase DFD........................................................................29
Figure 12 Customers – New User Registration DFD...........................................................................30
Figure 13 Administrator Context DFD................................................................................................30
Figure 14 Administrator Detailed DFD...............................................................................................30
Figure 15 Web page programming options..........................................................................................36
Figure 16 Compiled server programs flowchart..................................................................................37
Figure 17 ASP.NET APPLICATION..................................................................................................47

v
DECLARATION

I Onayemi Yusuf Adewale humbly declares that this work entitled ‘DESIGN AND
IMPLEMENTATION OF ONLINE SHOPPING CART’ is as a result of my research
effort carried in the School of Science and Technology, National Open University of Nigeria,
under the supervision of Mr. Enakeno Jituboh.

I further wish to declare that, to the best knowledge and belief, it contains no material
previously published either written by another person or material which to a substantial
extent has been accepted for the award of other degree or diploma of any university or other
institution of higher learning, except one acknowledgement has been made in text.

……………………………

(Signature/Name/date)

vi
CERTIFICATION

This is to certify that the research project entitled DESIGN AND IMPLEMENTATION OF
ONLINE SHOPPING CART was carried out by Onayemi Yusuf Adewale in the School of
Science and Technology, National Open University of Nigeria, Lagos for the award of
Bachelor of Science degree in Computer Science.

…………………………… ………………………………

Enakeno Jituboh Name and Signature


(Supervisor) Programme Leader

…………………………. …………………………….

Date Date

………………………… ………………………………
Prof. David Adewunmi Date
(Dean of faculty)

vii
DEDICATION

This project is dedicated to Almighty Allah whom by his strength makes it possible for me to
be able to finish my programme in this school (National Open University of Nigeria,
Agidingbi centre) and great thanks to my beloved parents Mr.&Mrs. Onayemi, my siblings
and my extended family and friends. May the Almighty Allah bless you all abundantly,
Amen.

viii
ACKNOWLEDGEMENT
My greatest gratitude goes to our fruitarian God (the prime mover) for his protection,
guidance, sustenance and provision throughout the period of my academic pursuit and
beyond.

I wish to express my heartfelt gratitude to my supervisor Mr. Enakeno Jituboh who from his
wealth of knowledge contributed immensely to the success of this research work.

I am also grateful to our Dean Prof. David Adewunmi and our legible lecturers for their
encouragement and moral advice.

Special thanks goes to my beloved parents Mr/Mrs. Onayemi, Mr. Ismail Onayemi, Mr/Mrs
Saliu, Mr. Oke Kunle and my siblings Tunde, Hakeem, Fatimat, Zainab, Qudus and Samiat,
also my extended family, friends and lovers for their support and effort towards me during
my studies.

Finally I owe a lot of thanks to various authors and scholars whose ideas have been put
forward in this write up.

ix
Abstract
The business-to- consumer aspect of an online shopping is the most visible business use of
the World Wide Web. The primary goal of an online shopping site is to sell goods and
services online. This project deals with developing an e- commerce website for online
shopping. It provides the user with a catalogue of different goods and services available for
purchase in the store. In order to facilitate online purchase a shopping cart is provided to the
user. The system is implemented using a 3- tier approach, with a backend database, a middle
tier of Microsoft Internet Information Services (MIIS) and PHP, and a web browser as the
front end client. In order to develop an e- commerce website for online shopping, a number
of Technologies must be studied and understood. These include multi- tiered architecture,
server and client side scripting techniques, implementation technologies such as ASP.NET,
programming language (such as C#, VB.NET), relational databases (such as MySQL,
Access). This is a project with the objective to develop a basic website where a consumer is
provided with a shopping cart application and also to know about the technologies used to
develop such an application. This document will discuss each of the underlying technologies
to create and implement an e-commerce website for online shopping.

x
CHAPTER 1
1.0 Introduction
E-commerce is fast gaining ground as an accepted and used business paradigm. More
and more business houses are implementing web sites providing functionality for performing
commercial transactions over the web. It is reasonable to say that the process of shopping on
the web is becoming common place.

The objective of this project is to develop a general purpose e-commerce store where
any product (such as books, CDs, computers, mobile phones, electronic items, home
appliances and any kind of goods) can be bought from the comfort of home through the
Internet. However, for implementation purposes, this paper will deal with an online book
store.

An online store is a virtual store on the Internet where customers can browse the
catalogue and select products of interest. The selected items may be collected in a shopping
cart. At checkout time, the items in the shopping cart will be presented as an order. At that
time, more information will be needed to complete the transaction. Usually, the customer will
be asked to fill or select a billing address, a shipping address, a shipping option, and payment
information such as credit card number. An e- mail notification is sent to the customer as
soon as the order is placed.

Business conducted through the use of computers, telephones, fax machines, barcode
readers, credit cards, automated teller machines (ATM) or other electronic appliances
(whether or not using the internet) without the exchange of paper-based documents. It
includes activities such as procurement, order entry, transaction processing, payment,
authentication and non-repudiation, inventory control, order fulfilment, and customer
support. When a buyer pays with a bank card swiped through a magnetic-stripe-reader, he or
she is participating in e-commerce.[35]

With popular trends and demands the concept of the Internet as the way forward to
increase profit margins, companies new and old are creating websites here and there. The
significance for retailers to having a web site is that a web site is informational and
transactional in nature [43]. As the web site can be used for advertising, direct marketing, sales,
customer support and public relations.
1
Significantly according to a study by McKinsey & Company and Salomon Smith
Barney, retailers who sell to their customers through catalogues; stores, and online
significantly emerge victorious amid the e-tail shake out [44].

With seasonal events and holidays, the Internet has become a tool for a quick and stress free
method of shopping. Allowing retailers to cash in the profit from another useful shopping
channel. Jupiter Research expects 2003’s online holiday sales to be led by new shoppers,
resulting in a 21 percent increase over 2002 figures [45]. The growth in holiday sales is driven
by factors such as, online bargains; time saving; avoiding holiday crowds and much more.

The top categories of Online Sales according to comScore Networks are:

 Computer Hardware and Software

 Apparel and Accessories

 Office Supplies

 Books, Music and Movies

 Consumer Electronics

 Home and Garden

 Health and Beauty

 Gifting

 Sporting Goods

 Toys and Games

 Autos

 Pets

Freedman argues that as more consumers are able to connect to faster Internet connections
categories such as Apparel may experience growth [36].

2
1.1 Problem
After studying a number of shopping cart solutions online like Konga, Jumia, E-bay
etc., I thought of introducing a new concept in the existing line of Shopping Cart solutions
and it is the advertisement module. The existing products cover particular set of features and
most of them share the standard features of online shopping. These products are off the shelf
and take time to customize or difficult to alter. These have most common features like:

The admin is the vendor itself. An Admin is a person who owns/opens a store and
uploads the catalogue of the products he deals in. These products can be software / hardware
or products. Virtually any kind of product can be listed in the catalogue.

The other section relates to the customers and online visitors who make purchases of the
available products.

There are a number of installable modules (components) that relate to the payment gateway
and can be activated / deactivated on one click.

Limitations: There is no vendor / customer interaction like messaging. The vendor can’t earn
revenue by putting advertisements.

1.2 Revenue Model


The revenue model is very simple; most of the solutions are freely available and come
in self owned stores like osCommerce. These products can be installed on individual domain
and many firms develop installable modules for these or customize as per user requirement.
The provider does not take any revenue for sharing the software.

Some of the product providers charge commission as per the terms and conditions like pay
per sale etc.

On the other hand, the vendor/admin, earns revenue from the catalogue for the
products he deals in for freely available portal. A major source of revenue is through
advertisement.

Advertisement: Advertising is any paid form of non-personal presentation and promotion of


ideas, goods, or services by an identified sponsor.

3
Normally it shows growing trend of consumers being more resistant to advertising messages
and less open to marketers communicating with them without their expressed permission.
Advertising models are continuously evolving due to an explosion in media outlets.

Advertising comes with several advantages which include:

1. Attention
2. Hold Interest
3. Arouse Desire
4. Obtain Action.

There are various ways of advertising but we talk about only website advertising.

In Today’s modern era website is good way to advertise your product, event, idea or brand.
You can run your advertisements on websites with highly target traffic and likely buyers but
you may also create entire websites dedicated to advertising your product.

1.3 Aim and Objectives


I have made an attempt to introduce a new concept of revenue earning and that is by
placing advertisements on the portal on some of the specific areas of the portal pages. The
advertising agency will be choosing the plan and pay as per the terms and conditions. On the
other hand we can also charge Pay Per Click (PPC). The individual can place its business
advertisement from the plans available.

The primary aim of this project is to demonstrate that with better interactive features
in e-commerce web sites could improve sales for online retailers. The objectives of the
project are as follows:

 To learn about the Online Shopping industry.


 To investigate potential problems with Online Shopping.
 To create a prototype web site focusing on one of the many problems that arises
within Online Shopping.
 To evaluate the prototype with an existing online e-commerce website.
The classic tale of the tortoise and the hare, provided by Freedman, gave the inspiration that
Online Shopping is one the main markets that need to be tapped in. Freedman’s prediction is
that, slower starters or early laggards may prove to be some of the strongest categories online
long term.
4
5
CHAPTER 2
2.0 Literature Review

2.1 History of E-commerce


Online shopping or e-shopping is a form of electronic commerce which allows
consumers to directly buy goods or services from a seller over the Internet using a web
browser. Alternative names are: e-web-store, e-shop, e-store, Internet shop, web-shop, web-
store, online store, online storefront and virtual store. Mobile commerce (or m-commerce)
describes purchasing from an online retailer's mobile optimized online site or app.

Electronic Commerce (e-commerce) applications support the interaction between


different parties participating in a commerce transaction via the network, as well as the
management of the data involved in the process.

An online shop evokes the physical analogy of buying products or services at


a bricks-and-mortar retailer or shopping centre; the process is called business-to-consumer
(B2C) online shopping. In the case where a business buys from another business, the process
is called business-to-business (B2B) online shopping. The largest of these online retailing
corporations are Alibaba, Amazon.com, and eBay.[1] Retail success is no longer all about
physical stores. This is evident because of the increase in retailers now offering online store
interfaces for consumers. With the growth of online shopping, comes a wealth of new market
footprint coverage opportunities for stores that can appropriately cater to offshore market
demands and service requirements.

English entrepreneur Michael Aldrich invented online shopping in 1979. His system


connected a modified domestic TV to a real-time transaction processing computer via a
domestic telephone line. He believed that videotex, the modified domestic TV technology
with a simple menu-driven human–computer interface, was a 'new, universally applicable,
participative communication medium — the first since the invention of the telephone.' This
enabled 'closed' corporate information systems to be opened to 'outside' correspondents not
just for transaction processing but also for e-messaging and information retrieval and
dissemination, later known as e-business.[2] His definition of the new mass communications
medium as 'participative' [interactive, many-to-many] was fundamentally different from the

6
traditional definitions of mass communication and mass media and a precursor to the social
networking on the Internet 25 years later.

In March 1980 he went on to launch Redifon's Office Revolution, which allowed consumers,
customers, agents, distributors, suppliers and service companies to be connected on-line to
the corporate systems and allow business transactions to be completed electronically in real-
time.[3]

During the 1980s[4] he designed, manufactured, sold, installed, maintained and


supported many online shopping systems, using videotex technology. [5] These systems which
also provided voice response and handprint processing pre-date the Internet and the World
Wide Web, the IBM PC, and Microsoft MS-DOS, and were installed mainly in the UK by
large corporations.

The first World Wide Web server and browser, created by Tim Berners-Lee in 1990,
opened for commercial use in 1991.[6] Thereafter, subsequent technological innovations
emerged in 1994: online banking, the opening of an online pizza shop by Pizza Hut,
[6]
 Netscape's SSL v2 encryption standard for secure data transfer, and Intershop's first online
shopping system. Immediately after, Amazon.com launched its online shopping site in 1995
and eBay was also introduced in 1995.[6]

2.1.1 International E-Commerce statistics


Statistics show that in 2012, Asia-Pacific increased their international sales over 30% giving
them over $433 billion in revenue. That is a $69 billion difference between the U.S. revenue
of $364.66 billion. It is estimated that Asia-Pacific will increase by another 30% in the year
2013 putting them ahead by more than one-third of all global ecommerce sales.[8]

2.1.2 Customers
Online customers must have access to the Internet and a valid method of payment in order to
complete a transaction.

Generally, higher levels of education and personal income correspond to more favourable
perceptions of shopping online. Increased exposure to technology also increases the
probability of developing favourable attitudes towards new shopping channels.[7]

7
In a December 2011 study, Equation Research surveyed 1,500 online shoppers and found that
87% of tablet owners made online transactions with their tablet devices during the early
Christmas shopping season.[8]

2.1.3 Logistics
Consumers find a product of interest by visiting the website of the retailer directly or by
searching among alternative vendors using a shopping search engine.

Once a particular product has been found on the website of the seller, most online retailers
use shopping cart software to allow the consumer to accumulate multiple items and to adjust
quantities, like filling a physical shopping cart or basket in a conventional store. A
"checkout" process follows (continuing the physical-store analogy) in which payment and
delivery information is collected, if necessary. Some stores allow consumers to sign up for a
permanent online account so that some or all of this information only needs to be entered
once. The consumer often receives an e-mail confirmation once the transaction is complete.

Less sophisticated stores may rely on consumers to phone or e-mail their orders (although full
credit card numbers, expiry date, and Card Security Code,[9] or bank account and routing
number should not be accepted by e-mail, for reasons of security).

2.1.4 Payment
Online shoppers commonly use a credit card or a PayPal account in order to make payments.
However, some systems enable users to create accounts and pay by alternative means, such
as:

 Billing to mobile phones and landlines[10][11]


 Cash on delivery (C.O.D.)
 Cheque/ Check
 Debit card
 Direct debit in some countries
 Electronic money of various types
 Gift cards
 Postal money order
 Wire transfer/delivery on payment
 Invoice, especially popular in some markets/countries, such as Switzerland
8
 Bitcoin or other cryptocurrencies

Some online shops will not accept international credit cards. Some require both the
purchaser's billing and shipping address to be in the same country as the online shop's base of
operation. Other online shops allow customers from any country to send gifts anywhere.

The financial part of a transaction may be processed in real time (e.g. letting the consumer
know their credit card was declined before they log off), or may be done later as part of the
fulfilment process.

2.1.5 Product delivery


Once a payment has been accepted, the goods or services can be delivered in the following
ways:

1. Downloading/Digital distribution:[12] The method often used for digital media


products such as software, music, movies, or images.
2. Drop shipping: The order is passed to the manufacturer or third-party distributor,
who then ships the item directly to the consumer, bypassing the retailer's physical
location to save time, money, and space.
3. In-store pick-up: The customer selects a local store using a locator software and
picks up the delivered product at the selected location. This is the method often
used in the bricks and clicks business model.
4. Printing out, provision of a code for, or e-mailing of such items as admission tickets
and scrip (e.g., gift certificates and coupons). The tickets, codes, or coupons may be
redeemed at the appropriate physical or online premises and their content reviewed
to verify their eligibility (e.g., assurances that the right of admission or use is
redeemed at the correct time and place, for the correct dollar amount, and for the
correct number of uses).
5. Shipping: The product is shipped to a customer-designated address.
6. Will call, lCOBO (in Care Of Box Office), or "at the door" pickup: The patron
picks up pre-purchased tickets for an event, such as a play, sporting event, or
concert, either just before the event or in advance. With the onset of the Internet and
e-commerce sites, which allow customers to buy tickets online, the popularity of
this service has increased.

9
2.1.6 Shopping cart systems
Simple systems allow the off-line administration of products and categories. The shop
is then generated as HTML files and graphics that can be uploaded to a webspace. The
systems do not use an online database.
A high-end solution can be bought or rented as a stand-alone program or as an addition to an
enterprise resource planning program. It is usually installed on the company's webserver and
may integrate into the existing supply chain so that ordering, payment, delivery, accounting
and warehousing can be automated to a large extent.
Other solutions allow the user to register and create an online shop on a portal that hosts
multiple shops simultaneously from one back office.
Open source shopping cart packages include advanced platforms such as Interchange,
and off-the-shelf solutions such as Magento, nopCommerce, osCommerce, Shopgate,
PrestaShop, Shopify, Zen Cart, OpenCart.
Commercial systems can also be tailored so the shop does not have to be created from
scratch. By using an existing framework, software modules for various functionalities
required by a web shop can be adapted and combined.

2.1.7 Online gift shops

Online gift shops are websites which have the primary objective of selling products online
that will be given to others. These online retailers may or may not be associated to a physical
shop.

2.1.8 Design

Customers are attracted to online shopping not only because of high levels of convenience,
but also because of broader selections, competitive pricing, and greater access to information.
[13][14]
 Business organizations seek to offer online shopping not only because it is of much
lower cost compared to bricks and mortar stores, but also because it offers access to a
worldwide market, increases customer value, and builds sustainable capabilities.

2.1.9 Information load

Designers of online shops are concerned with the effects of information load.
Information load is a product of the spatial and temporal arrangements of stimuli in the web
store.[16]Compared with conventional retail shopping, the information environment of virtual

10
shopping is enhanced by providing additional product information such as comparative
products and services, as well as various alternatives and attributes of each alternative, etc.[17]

Two major dimensions of information load are complexity and novelty. [18] Complexity refers
to the number of different elements or features of a site, often the result of increased
information diversity. Novelty involves the unexpected, suppressed, new, or unfamiliar
aspects of the site. The novelty dimension may keep consumers exploring a shopping site,
whereas the complexity dimension may induce impulse purchases.[17]

2.1.10 Consumer needs and expectations

A successful webstore is not just a good looking website with dynamic technical


features, listed in many search engines.[19] In addition to disseminating information, it is also
about building a relationship with customers and making money.

Businesses often attempt to adopt online shopping techniques without understanding


them and/or without a sound business model; often, businesses produce webstores that
support the organizations' culture and brand name without satisfying consumer expectations.
User-centered design is critical. Understanding the customer's wants and needs is essential.
Living up to the company's promises gives customers a reason to come back and meeting
their expectations gives them a reason to stay. It is important that the website communicates
how much the company values its customers.[19]

Customer needs and expectations are not the same for all customers. Age, gender,
experience and culture are all important factors. For example, Japanese cultural norms may
lead users there to feel privacy is especially critical on shopping sites and emotional
involvement is highly important on financial pensions sites. [15] Users with more online
experience focus more on the variables that directly influence the task, while novice users
focus on understanding the information.[20]

To increase online purchases, businesses must use significant time and money to
define, design, develop, test, implement, and maintain the webstore. [19] Truly said, it is easier
to lose a customer than to gain one. Even a "top-rated" website will not succeed if the
organization fails to practice common etiquette such as responding to e-mails in a timely
fashion, notifying customers of problems, being honest, and being good stewards of the
customers' data.[19] Because it is so important to eliminate mistakes and be more appealing to
online shoppers, many webshop designers study research on consumer expectations.[21]

11
2.1.11 User Interface
The most important factors determining whether customers return to a website are ease of use
and the presence of user-friendly features.[22]Usability testing is important for finding
problems and improvements in a web site. Methods for evaluating usability include heuristic
evaluation, cognitive walkthrough, and user testing. Each technique has its own
characteristics and emphasizes different aspects of the user.

2.1.12 Market Share

E-commerce B2C product sales totalled $142.5 billion, [8] representing about 8% of


retail product sales in the United States. [23] The $26 billion worth of clothes sold online
represented about 13% of the domestic market,[24] and with 72% of women looking online for
apparel, it has become one of the most popular cross-shopping categories [25] Forrester
Research estimates that the United States online retail industry will be worth $279 billion in
2015.[26] There were 242 million people shopping on-line in China in 2012.[27]

For developing countries and low-income households in developed countries, adoption of e-


commerce in place of or in addition to conventional methods is limited by a lack of
affordable Internet access.

2.2 Advantages and disadvantages of E-commerce


2.2.1 Advantages of E-commerce

There are various advantages of E-commerce which includes:

Convenience

Online stores are usually available 24 hours a day, and many consumers have Internet access
both at work and at home. Other establishments such as internet cafes and schools provide
internet access as well. In contrast, visiting a conventional retail store requires travel and
must take place during business hours.

In the event of a problem with the item (e.g., the product was not what the consumer ordered,
the product was not satisfactory), consumers are concerned with the ease of returning an item
in exchange for either the correct product or a refund. Consumers may need to contact the
retailer, visit the post office and pay return shipping, and then wait for a replacement or
refund. Some online companies have more generous return policies to compensate for the
traditional advantage of physical stores. For example, the online shoe
12
retailer Zappos.com includes labels for free return shipping, and does not charge a restocking
fee, even for returns which are not the result of merchant error. (Note: In the United
Kingdom, online shops are prohibited from charging a restocking fee if the consumer cancels
their order in accordance with the Consumer Protection (Distance Selling) Act 2000).[28]

Information and reviews

Online stores must describe products for sale with text, photos, and multimedia files, whereas
in a physical retail store, the actual product and the manufacturer's packaging will be
available for direct inspection (which might involve a test drive, fitting, or other
experimentation).

Some online stores provide or link to supplemental product information, such as instructions,
safety procedures, demonstrations, or manufacturer specifications. Some provide background
information, advice, or how-to guides designed to help consumers decide which product to
buy.

Some stores even allow customers to comment or rate their items. There are also
dedicated review sites that host user reviews for different products. Reviews and even some
blogs give customers the option of shopping for cheaper purchases from all over the world
without having to depend on local retailers.

In a conventional retail store, clerks are generally available to answer questions. Some online
stores have real-time chat features, but most rely on e-mails or phone calls to handle customer
questions.

Price and selection

One advantage of shopping online is being able to quickly seek out deals for items or services
provided by many different vendors (though some local search engines do exist to help
consumers locate products for sale in nearby stores). Search engines, online price comparison
services and discovery shopping engines can be used to look up sellers of a particular product
or service.

Shipping costs (if applicable) reduce the price advantage of online merchandise, though
depending on the jurisdiction, a lack of sales tax may compensate for this.

Shipping a small number of items, especially from another country, is much more expensive
than making the larger shipments bricks-and-mortar retailers order. Some retailers (especially

13
those selling small, high-value items like electronics) offer free shipping on sufficiently large
orders.

Another major advantage for retailers is the ability to rapidly switch suppliers and vendors
without disrupting users' shopping experience.

2.2.2 Disadvantages of E-Commerce


The disadvantages of e-commerce include:

Fraud and security concerns

Given the lack of ability to inspect merchandise before purchase, consumers are at higher risk
of fraud than face-to-face transactions. Merchants also risk fraudulent purchases using stolen
credit cards or fraudulent repudiation of the online purchase. However, merchants face less
risk from physical theft by using a warehouse instead of a retail storefront.

Secure Sockets Layer (SSL) encryption has generally solved the problem of credit card
numbers being intercepted in transit between the consumer and the merchant. However, one
must still trust the merchant (and employees) not to use the credit card information
subsequently for their own purchases, and not to pass the information to others. Also, hackers
might break into a merchant's web site and steal names, addresses and credit card numbers,
although the Payment Card Industry Data Security Standard is intended to minimize the
impact of such breaches. Identity theft is still a concern for consumers. A number of high-
profile break-ins in the 2000s has prompted some U.S. states to require disclosure to
consumers when this happens. Computer security has thus become a major concern for
merchants and e-commerce service providers, who deploy countermeasures such as firewalls
and anti-virus software to protect their networks.

Phishing is another danger, where consumers are fooled into thinking they are dealing
with a reputable retailer, when they have actually been manipulated into feeding private
information to a system operated by a malicious party. Denial of service attacks are a minor
risk for merchants, as are server and network outages.

Quality seals can be placed on the Shop web page if it has undergone an independent
assessment and meets all requirements of the company issuing the seal. The purpose of these
seals is to increase the confidence of online shoppers. However, the existence of many
different seals, or seals unfamiliar to consumers, may foil this effort to a certain extent. A

14
number of resources offer advice on how consumers can protect themselves when using
online retailer services. These include:

 Sticking with known stores, or attempting to find independent consumer reviews of


their experiences; also ensuring that there is comprehensive contact information on
the website before using the service, and noting if the retailer has enrolled in industry
oversight programs such as a trust mark or a trust seal.
 Before buying from a new company, evaluate the website by considering issues such
as: the professionalism and user-friendliness of the site; whether or not the company
lists a telephone number and/or street address along with e-contact information;
whether a fair and reasonable refund and return policy is clearly stated; and whether
there are hidden price inflators, such as excessive shipping and handling charges.
 Ensuring that the retailer has an acceptable privacy policy posted. For example note if
the retailer does not explicitly state that it will not share private information with
others without consent.
 Ensuring that the vendor address is protected with SSL (see above) when entering
credit card information. If it does the address on the credit card information entry
screen will start with "HTTPS".
 Using strong passwords, without personal information. Another option is a "pass
phrase," which might be something along the lines: "I shop 4 good a buy!!" These are
difficult to hack, and provides a variety of upper, lower, and special characters and
could be site specific and easy to remember.

Although the benefits of online shopping are considerable, when the process goes poorly it
can create a thorny situation. A few problems that shoppers potentially face include identity
theft, faulty products, and the accumulation of spyware. If users are required to put in their
credit card information and billing/shipping address and the website is not secure, customer
information can be accessible to anyone who knows how to obtain it. Most large online
corporations are inventing new ways to make fraud more difficult. However, criminals are
constantly responding to these developments with new ways to manipulate the system. Even
though online retailers are making efforts to protect consumer information, it is a constant
fight to maintain the lead. It is advisable to be aware of the most current technology and
scams protect consumer identity and finances.

15
Product delivery is also a main concern of online shopping. Most companies offer shipping
insurance in case the product is lost or damaged. Some shipping companies will offer refunds
or compensation for the damage, but this is up to their discretion.

Lack of full cost disclosure

The lack of full cost disclosure may also be problematic. While it may be easy to compare the
base price of an item online, it may not be easy to see the total cost up front. Additional fees
such as shipping are often not be visible until the final step in the checkout process. The
problem is especially evident with cross-border purchases, where the cost indicated at the
final checkout screen may not include additional fees that must be paid upon delivery such
as duties and brokerage. Some services such as the Canadian based Wishabi attempts to
include estimates of these additional cost,[29] but nevertheless, the lack of general full cost
disclosure remains a concern.

Privacy

Privacy of personal information is a significant issue for some consumers. Many consumers
wish to avoid spam and telemarketing which could result from supplying contact information
to an online merchant. In response, many merchants promise to not use consumer information
for these purposes,

Many websites keep track of consumer shopping habits in order to suggest items and other
websites to view. Brick-and-mortar stores also collect consumer information. Some ask for a
shopper's address and phone number at checkout, though consumers may refuse to provide it.
Many larger stores use the address information encoded on consumers' credit cards (often
without their knowledge) to add them to a catalogue mailing list. This information is
obviously not accessible to the merchant when paying in cash or through a bank (money
transfer, in which case there is also proof of payment).

2.2.3 Product Suitability

Many successful purely virtual companies deal with digital products, (including


information storage, retrieval, and modification), music, movies, office supplies, education,
communication, software, photography, and financial transactions. Other successful
marketers use drop shipping or affiliate marketing techniques to facilitate transactions of
tangible goods without maintaining real inventory.

16
Some non-digital products have been more successful than others for online stores.
Profitable items often have a high value-to-weight ratio, they may involve embarrassing
purchases, they may typically go to people in remote locations, and they may have shut-ins as
their typical purchasers. Items which can fit in a standard mailbox such as music CDs, DVDs
and books are particularly suitable for a virtual marketer.

Products such as spare parts, both for consumer items like washing machines and for
industrial equipment like centrifugal pumps, also seem good candidates for selling online.
Retailers often need to order spare parts specially, since they typically do not stock them at
consumer outlets in such cases, e-commerce solutions in spares do not compete with retail
stores, only with other ordering systems. A factor for success in this niche can consist of
providing customers with exact, reliable information about which part number their particular
version of a product needs, for example by providing parts lists keyed by serial number.

Products less suitable for e-commerce include products that have a low value-to-
weight ratio, products that have a smell, taste, or touch component, products that need trial
fittings most notably clothing and products where colour integrity appears important.
Nonetheless, some web sites have had success delivering groceries and clothing sold through
the internet is big business in the U.S.

2.2.4 Aggregation

High-volume websites, such as Yahoo!, Amazon.com, and eBay, offer hosting services for
online stores to all size retailers. These stores are presented within an integrated navigation
framework, sometimes known as virtual shopping malls or online marketplaces.

2.2.5 Impact of reviews on consumer behaviour

One of the great benefits of online shopping is the ability to read product reviews,
written either by experts or fellow online shoppers.

The Nielsen Company conducted a survey in March 2010 and polled more than 27,000
Internet users in 55 markets from the Asia-Pacific, Europe, Middle East, North America, and
South America to look at questions such as "How do consumers shop online?", "What do
they intend to buy?", "How do they use various online shopping web pages?", and the impact
of social media and other factors that come into play when consumers are trying to decide
how to spend their money on which product or service. According to the research,[30] reviews
on electronics (57%) such as DVD players, cell phones, or PlayStations, and so on, reviews

17
on cars (45%), and reviews on software (37%) play an important role in influencing
consumers who tend to make purchases online. Furthermore, 40% of online shoppers indicate
that they would not even buy electronics without consulting online reviews first.

In addition to online reviews, peer recommendations on online shopping pages or


social media websites play a key role [31] for online shoppers when they are researching future
purchases.[32] 90% of all purchases made are influenced by social media. [33] Each day, over
two million buyers are shopping online for jewelry.[34]

18
CHAPTER 3
3.0 Project Design
In order to design a web site, the relational database must be designed first.
Conceptual design can be divided into two parts: The data model and the process model.
The data model focuses on what data should be stored in the database while the process
model deals with how the data is processed. To put this in the context of the relational
database, the data model is used to design the relational tables. The process model is used to
design the queries that will access and perform operations on those tables.

3.1 Data Model


A data model is a conceptual representation of the data structures that are required by
a database. The first step in designing a database is to develop an Entity- Relation Diagram
(ERD). The ERD serves as a blue print from which a relational database maybe deduced.
Figure 1 shows the ERD for the project and later we will show the transformation from ERD
to the Relational model.

19
Credit card 1:1 has 1:1 Customer 1:1 write: 0:M Review

1:1 1:1 0:M

has files has

1:1 1:M 1:1

Shipping Type 1:1 has 0:M Order details Shopping cart items Inventory

0:M 0:M

is in has

0:1 1:1

Purchase history state tax

Figure 1 Entity Relationship


Diagram (ERD)
In the ERD, a rectangle is used to represent a table and a diamond to represent the
relationship between the entities. The cardinality is the frequency of a relationship between
two entities. The types of cardinality are one to one (1:1), one to many (1:M), zero to many

20
(0:M) and many to many (M:M). One to one means that every record in entity A matches
exactly one record in entity B and every record in B matches exactly one record in A. One to
many means that every record in A matches zero or more records in B and every record in B
matches exactly one record in A. If there is a one to many relationships between two entities,
then these entities are represented as Associative Entities. In the Relational Database model,
each of the entities will be transformed into a table. The tables are shown below along with
the attributes.

3.2 Database Design


In this section, the basic structure of the tables composing the database for the project
are shown along with information about primary and foreign keys.

Customer
S/NO NAME DATA TYPE DESCRIPTION__
1 UserID Varchar Primary key for Customer identification
2 Password Varchar Security for Customer
3 First_Name Varchar
4 Last_Name Varchar
5 Address Varchar
6 City Varchar
7 State Varchar
8 Email Address Varchar
9 Phone_Number Integer

Books
S/NO NAME DATA TYPE DESCRIPTION
1 InventoryID Integer Primary key for Inventory Identification,
ISBN of a book
2 Book_Name Varchar
3 Author Varchar
5 Nr_books Integer
6 Price Double

21
State Tax
S/NO NAME DATA TYPE DESCRIPTION
1 State Name Varchar Primary key for State Identification
2 Sales Tax Rate Double Sales tax for each state

Shopping Cart Items


S/NO NAME DATA TYPE DESCRIPTION
1 Shopping Cart ID Integer Primary key for Shopping Cart
Identification
2 InventoryID Varchar Foreign key to Inventory
3 Price Double
4 Date Date
5 UserID Varchar Foreign key to Customer
6 Quantity Integer

Order Details
S/NO NAME DATA TYPE DESCRIPTION
1 OrderID Integer Primary key for Order identification
2 UserID Char Foreign key to Customer
3 Receiver’s Name Char If order is to be sent to other address rather
than to the customer, we need that address
4 Address Char
5 City Char
6 Zip Integer
7 State Char Foreign key to State Tax
8 Type of Shipping Char Foreign key to Shipping Type
9 Date of Purchase Date

Shipping Type
S/NO NAME DATA TYPE DESCRIPTION
1 Type of Shipping Varchar Primary key to define type of shipping
2 Price Double
3 Approximate days Integer for delivery

22
Credit Card Details
S/NO NAME DATA TYPE DESCRIPTION
1 Credit Username Varchar Primary key for Customer Identification
2 Credit Card Varchar Number
3 Card Type Varchar Master Card, Visa, Discover
4 CVV Number Integer Number present on the back of the card
for extra security
5 Expiry Date Date
6 UserID Varchar Foreign key to Customer

Book Review
S/NO NAME DATA TYPE DESCRIPTION
1 InventoryID Varchar ISBN of the book on which the review is written
2 Reviews Varchar Review on the book
3 Rating Varchar Rating given to the book in a scale of 5
4 Review Date Date
5 User Name Varchar Name of the user providing the review

Purchase History
S/NO NAME DATA TYPE DESCRIPTION
1 UserID Varchar Primary key for Customer Identification
2 InventoryID Varchar Book purchased by the user
3 Date of Purchase Date
4 OrderID Integer Foreign key to Order details
5 Quantity Integer
6 Price Double

3.3 Process Model


A Process Model tells us about how the data is processed and how the data flows from
one table to another to gather the required information. This model consists of the Functional
Decomposition Diagram and Data Flow Diagram.

23
3.3.1 Functional Decomposition Diagram
A decomposition diagram shows a top-down functional decomposition of a system
and exposes the system's structure. The objective of the Functional Decomposition is to break
down a system step by step, beginning with the main function of a system and continuing
with the interim levels down to the level of elementary functions. The diagram is the starting
point for more detailed process diagrams, such as data flow diagrams (DFD). Figure 2 shows
the Functional Decomposition Diagram for this project.
Customer Home Page

Customer Registration Product / Search Help? /FAQ


engine

User page View cart


Database

Add to cart Payment Terms

Confirmation

Transaction
Acknowledgment

Administrator Admin Home Page

Administrative services

Add/Edit inventory

Add new Update


book inventory

Figure 2 Functional Decomposition Diagram


24
3.3.2 Data Flow Diagram (DFD)
Data Flow Diagrams show the flow of data from external entities into the system, and
from one process to another within the system. There are four symbols for drawing a DFD:
1. Rectangles representing external entities, which are sources or destinations of data.
2. Ellipses representing processes, which take data as input, validate and process it and
output it.
3. Arrows representing the data flows, which can either, be electronic data or physical
items.
4. Open-ended rectangles or a Disk symbol representing data stores, including
electronic stores such as databases or XML files and physical stores such as filing
cabinets or stacks of paper.

Figures 3 - 14 are the Data Flow Diagrams for the current system. Each process within the
system is first shown as a Context Level DFD and later as a Detailed DFD. The Context
Level DFD provides a conceptual view of the process and its surrounding input, output and
data stores. The Detailed DFD provides a more detailed and comprehensive view of the
interaction among the sub -processes within the system.

Figure 3 Customer - Browse Context DFD

25
Figure 4 Customer Browse Detailed DFD

Figure 5 Customer – Shopping Cart Context DFD

Figure 6 Customer - Shopping Cart Detailed DFD

26
Figure 7 Customer - Shopping Cart Detailed DFD

Figure 8 Customer - Shopping Cart Detailed DFD

Figure 9 Customer – Authentication – User Profile DFD

27
Figure 10 Authenticated User-Purchase Context DFD

28
Figure 11 Customer - Authentication - Purchase DFD

29
user ID New User user id

Customer password Registration password Customer


address address

Figure 12 Customers – New User Registration DFD

Figure 13 Administrator Context DFD

Figure 14 Administrator Detailed DFD

30
CHAPTER 4
4.0 User Interface Design
Before implementing the actual design of the project, a few user interface designs
were constructed to visualize the user interaction with the system as they browse for books,
create a shopping cart and purchase books. The user interface design will closely follow our
Functional Decomposition Diagram (Figure 2). Appendix 1 figure1 – 6 show the initial
designs of the web pages.

4.1. Implementation Technologies


The objective of this project is to develop an online book store. When the user types
in the URL of the Book Store in the address field of the browser, a Web Server is contacted
to get the requested information in the .NET Framework, IIS (Internet Information Service)
acts as the Web Server. The sole task of a Web Server is to accept incoming HTTP requests
and to return the requested resource in an HTTP response. The first thing IIS does when a
request comes in is to decide how to handle the request. Its decision is based upon the
requested file's extension. For example, if the requested file has the .asp extension, IIS will
route the request to be handled by asp.dll. If it has the extension of .aspx, .ascx, etc, it will
route the request to be handled by ASP.NET Engine.

The ASP.NET Engine then gets the requested file, and if necessary contacts the
database through ADO.NET for the required file and then the information is sent back to the
Client’s browser. Appendix 1 Fig 7 shows how a client browser interacts with the Web server
and how the Web server handles the request from client.

4.2. Internet Information Services (IIS)


IIS is a set of Internet based services for Windows machines. Originally supplied as
part of the Option Pack for Windows NT, they were subsequently integrated with Windows
2000 and Windows Server 2003). The current (Windows 8) version is IIS 8.0 and includes
servers for FTP (a software standard for transferring computer files between machines with
widely different operating systems), SMTP (Simple Mail Transfer Protocol, is the de facto
standard for email transmission across the Internet) and HTTP/HTTPS (is the secure version
of HTTP, the communication protocol of the World Wide Web)[12].

Features: The web server itself cannot directly perform server side processing but can
delegate the task to ISAPI (Application Programming Interface of IIS) applications on the
31
server. Microsoft provides a number of these including ones for Active Server Page and
ASP.NET.

Compatibility: Internet Information Services is designed to run on Windows server


operating systems. Some restricted versions that support one web site and a limited number
of connections is also supplied with Windows XP Professional, Windows Vista, Windows 7
and Windows 8.

Microsoft has also changed the server account that IIS runs on. In versions of IIS
before 8.0, all the features were run on the System account, allowing exploits to run wild on
the system. Under 8.0 many of the processes have been brought under a Network Services
account that has fewer privileges. In particular this means that if there were an exploit on that
feature, it would not necessarily compromise the entire system.

4.3. ASP.NET
ASP.NET is a programming framework built on the common language runtime that can be
used on a server to build powerful Web applications. ASP.NET has many advantages – both
for programmers and for the end users because it is compatible with the .NET Framework.
This compatibility allows the users to use the following features through ASP.NET:

Powerful database-driven functionality: ASP.NET allows programmers to develop


web applications that interface with a database. The advantage of ASP.NET is that it
is object- oriented and has many programming tools that allow for faster development
and more functionality.
Faster web applications: Two aspects of ASP.NET make it fast – compiled code and
caching. In ASP.NET the code is compiled into "machine language" before a visitor
ever comes to the website. Caching is the storage of information in memory for faster
access in the future. ASP.NET allows programmers to set up pages or areas of pages
that are commonly reused to be cached for a set period of time to improve the
performance of web applications. In addition, ASP.NET allows the caching of data
from a database so the website is not slowed down by frequent visits to a database
when the data does not change very often.
Memory leak and crash protection: ASP.NET automatically recovers from memory
leaks and errors to make sure that the website is always available to the visitors.

32
ASP.NET also supports code written in more than 25 .NET languages (including VB.NET,
C#, and Jscript.Net). This is achieved by the Common Language Runtime (CLR) compiler
that supports multiple languages.

4.3.1. Authentication in ASP.NET


There are two separate authentication layers in an ASP.NET application. All requests flow
through IIS before they are handed to ASP.NET, and IIS can decide to deny access before
ASP.NET even knows about the request. Here is how the process works[14].

1. IIS checks to see if an incoming request is coming from an IP address that is allowed
access to the domain. If not, the request is denied.
2. IIS performs its own user authentication, if it is configured to do so. By default, IIS
allows anonymous access and requests are authenticated automatically.
3. When a request is passed from IIS to ASP.NET with an authenticated user, ASP.NET
checks to see whether impersonation is enabled. If so, ASP.NET acts as though it
were the authenticated user. If not, ASP.NET acts with its own configured account.
4. Finally, the identity is used to request resources from the operating system. If all the
necessary resources can be obtained, the user's request is granted; otherwise the
request is denied.

4.4. MySQL Database


In this project, MySQL is used as the backend database. MySQL is an open-source database
management system. The features of MySQL are given below:

 MySQL is a relational database management system. A relational database stores


information in different tables, rather than in one giant table. These tables can be
referenced to each other, to access and maintain data easily.
 MySQL is open source database system. The database software can be used and
modify by anyone according to their needs.
 It is fast, reliable and easy to use. To improve the performance, MySQL is multi-
threaded database engine. A multithreaded application performs many tasks at the
same time as if multiple instances of that application were running simultaneously.

In being multithreaded MySQL has many advantages. A separate thread handles each
incoming connection with an extra thread that is always running to manage the connections.
Multiple clients can perform read operations simultaneously, but while writing, only hold up
33
another client that needs access to the data being updated. Even though the threads share the
same process space, they execute individually and because of this separation, multiprocessor
machines can spread the thread across many CPUs as long as the host operating system
supports multiple CPUs. Multithreading is the key feature to support MySQL’s performance
design goals. It is the core feature around which MySQL is built.

MySQL database is connected to ASP.NET using an ODBC driver. Open Database


Connectivity (ODBC) is a widely accepted application-programming interface (API) for
database access. The ODBC driver is a library that implements the functions supported by
ODBC API. It processes ODBC function calls, submits SQL requests to MySQL server, and
returns results back to the application. If necessary, the driver modifies an application's
request so that the request conforms to syntax supported by MySQL.

4.5. Integrating IIS and ASP.NET


When a request comes into IIS Web server its extension is examined and, based on
this extension, the request is either handled directly by IIS or routed to an ISAPI extension.
An ISAPI extension is a compiled class that is installed on the Web server and whose
responsibility is to return the markup for the requested file type. By default, IIS handles the
request, and simply returns the contents of the requested file[13].

This makes sense for static files, like images, HTML pages, CSS files, external
JavaScript files, and so on. For example, when a request is made for a .html file, IIS simply
returns the contents of the requested HTML file.

For files whose content is dynamically generated, the ISAPI extension configured for
the file extension is responsible for generating the content for the requested file. For example,
a Web site that serves up classic ASP pages has the .asp extension mapped to the asp.dll
ISAPI extension. The asp.dll ISAPI extension executes the requested ASP page and returns
its generated HTML markup. If the Web site serves up ASP.NET Web pages, IIS has mapped
the .aspx to aspnet_isapi.dll, an ISAPI extension that starts off the process of generating the
rendered HTML for the requested ASP.NET Web page.

The aspnet_isapi.dll ISAPI extension is a piece of unmanaged code. That is, it is not
code that runs in the .NET Framework. When IIS routes the request to the aspnet_isapi.dll
ISAPI extension, the ISAPI extension routes the request onto the ASP.NET engine, which is
written in managed code – managed code is code that runs in the .NET Framework.
34
The ASP.NET engine is strikingly similar to IIS in many ways. Just like IIS has a
directory mapping file extensions to ISAPI extensions, the ASP.NET engine maps file
extensions to HTTP handlers. An HTTP handler is a piece of managed code that is
responsible for generating the markup for a particular file type.

4.6 Integrating the Website and Database


Customers ordering from an e-commerce website need to be able to get information
about a vendor’s products and services, ask questions, select items they wish to purchase, and
submit payment information. Vendors need to be able to track customer inquiries and
preferences and process their orders. So a well organized database is essential for the
development and maintenance of an e- commerce site [3].

In a static Web page, content is determined at the time when the page is created. As
users access a static page, the page always displays the same information. Example of a static
Web page is the page displaying company information. In a dynamic Web page, content
varies based on user input and data received from external sources. We use the term “data-
based Web pages” to refer to dynamic Web pages deriving some or all of their content from
data files or databases.

A data-based Web page is requested when a user clicks a hyperlink or the submit
button on a Web page form. If the request comes from clicking a hyperlink, the link specifies
either a Web server program or a Web page that calls a Web server program. In some cases,
the program performs a static query, such as “Display all items from the Inventory”.
Although this query requires no user input, the results vary depending on when the query is
made. If the request is generated when the user clicks a form’s submit button, instead of a
hyperlink, the Web server program typically uses the form inputs to create a query. For
example, the user might select five books to be purchased and then submit the input to the
Web server program. The Web server program then services the order, generating a dynamic
Web page response to confirm the transaction. In either case, the Web server is responsible
for formatting the query results by adding HTML tags. The Web server program then sends
the program’s output back to the client’s browser as a Web page.

4.7 Web Page Programming Options


An e-commerce organization can create data-based Web pages by using server-side
and client-side processing technologies or a hybrid of the two. With server- side processing,

35
the Web server receives the dynamic Web page request, performs all processing necessary to
create the page, and then sends it to the client for display in the client’s browser. Client- side
processing is done on the client workstation by having the client browser execute a program
that interacts directly with the database.

Figure 15 Web page programming options

Figure 15 (reproduced from [3]) outlines commonly used server-side, client- side, and
hybrid Web and data processing technologies; client-side scripts are in dashed lines to
indicate they are unable to interact directly with a database or file but are used to validate
user input on the client, and then send the validated inputs to the server for further processing.

4.7.1. Server-side processing.


Generally dynamic or data-driven Web pages use HTML forms to collect user inputs,
submitting them to a Web server. A program running on the server processes the form inputs,
dynamically composing a Web page reply. This program, which is called, servicing program,

36
can be either a compiled executable program or a script interpreted into machine language
each time it is run.

Compiled server programs. When a user submits HTML- form data for processing by a
compiled serve r program, the Web Server invokes the servicing program. The servicing
program is not part of the Web server but it is an independent executable program running on
the Web server; it processes the user input, determines the action which must be taken,
interacts with any external sources (E.g. database) and finally produces an HTML document
and terminates. The Web server then sends the HTML document back to the user’s browser
where it is displayed. Figure 17 shows the flow of HTTP request from the client to the Web
server, which is sent to the servicing program. The program creates an HTML document to
be sent to the client browser.

Figure 16 Compiled server programs flowchart

Popular languages for creating compiled server programs are Java, Visual Basic, and
C++, but almost any language that can create executable programs can be used, provided that
it supports commands used by one of the protocols that establish guidelines for
communication between Web servers and servicing programs. The first such protocol,
introduced in 1993, for use with HTML forms was the Common Gateway Interface (CGI);
many servicing programs on Web sites still use CGI programs. However, a disadvantage of
using CGI-based servicing programs is that each form submitted to a Web server starts its
own copy of the servicing program on the Web server.

A busy Web server is likely to run out of memory when it services many forms
simultaneously; thus, as interactive Web sites have gained popularity, Web server vendor s
have developed new technologies to process form inputs without starting a new copy of the
servicing program for each browser input. Examples of these technologies for communicating

37
with Web servers include Java Servlets [8] and Microsoft’s ASP.NET [7]; they allow a single
copy of the servicing program to service multiple users without starting multiple instances of
the program.

ASP.NET has introduced many new capabilities to server-side Web programming,


including a new category of elements called server controls that generate as many as 200
HTML tags and one or more JavaScript [9] functions from a single server control tag. Server
controls support the processing of user events, such as clicking a mouse or entering text at
either the client browser or the Web server. Server controls also encourage the separation of
programming code into different files and/or areas from the HTML tags and text of a Web
page, thus allowing HTML designers and programmers to work together more effectively.

Server-side scripts Web- based applications can also use server-side scripts to create dynamic
Web pages that are able to retrieve and display information from a backend database and
modify data records. The processing architecture is the same as the processing architecture
used for compiled server programs (Appendix1 Fig 7), except the Web server processing is
performed through and interpreted script rather than a compiled program.

If needed, a developer can have a single Web server process a variety of scripts written with
any or all of these technologies. The Web server knows which script interpreter to invoke by
taking note of the requesting script’s file extension. Table 1 below demonstrates some
commonly used extensions and the related technologies.

Table 1: Processing Technology for different File Extensions

File Extension Processing technology interpreter/compiler

.asp Microsoft Active Server Page

.aspx Microsoft ASP.NET web page

.js Microsoft Scripting Language “JScript” file extension


38
.php PHP Script

.vbp Visual Basic Project

Programs created through ASP.NET are not backward compatible with ASP scripts
created through the original ASP server-side scripting technology [10]; upgrading older ASP
scripts to ASP.NET requires substantial revision. ASP and ASP.NET programs can, however,
run on the same Web server, as ASP.NET programs are distinguished with .aspx file
extensions.

Server-side hybrid processing Compiled server- side programs offer two main advantages:
First, they are compiled and stored in a machine- readable format; so they usually run faster
than scripts. Second, compiled programs are usually created in integrated development
environments that provide debugging utilities. The advantage of using scripts is that their
modification requires only a text editor rather than installation of an associated development
environment.

Hybrid server-side programming strives to combine the advantages of compiled


server-side programs and server-side scripts; a server- side script is created but not compiled.
The first time a user accesses a Web page calling the script, the script is compiled into
machine- readable format and stored as an executable file. With this approach, the developer
works with ordinary text files and does not need to install an integrated programming
development environment to modify the script. Performance is improved because the
program does not need to be translated into machine language each time it runs.

In 1997, Sun Microsystems introduced Java Server Page (JSP) technology. Unlike
ASP scripts, JSP source code is automatically compiled into machine-readable format the
first time a user accesses it. The Web server saves the compiled JSP program, using it (rather
than the source code) the next time anyone else tries to access this particular JSP. This
scheme reduces both the processing performed and the time the user has to wait to view a
response from the Web server. If a programmer modifies the JSP source code, the Web server
notes that the source code file has been modified since the compiled version was created,
compiling and saving the compiled program the next time a user access the page. In 2002,
Microsoft introduced ASP.NET which is very similar to JSP with the additional flexibility

39
that many different source language s such as VB, C#, J# can be used to implement web
based applications.

Both ASP.NET and JSP are considered as Hybrid server side technologies. ASP.NET is
designed to work under the Windows/Server and IIS web server environment. JSP is more
portable as it works in most Operating Environments including Windows and Linux.

Choosing server-side processing From a performance standpoint, because compiled programs


execute faster than scripts, busy Web servers should use compiled server- side programs.
From a development standpoint, scripts are easier to create, modify and install without having
to stop the operation of the web application.

4.7.2. Client-Side Processing.


Client-side Web page processing is achievable through compiled programs
downloaded, installed, and executed on the client workstation or by creating scripts with the
HTML Web page commands interpreted by the client browser.

Downloading and running compiled programs on client workstations. When a user


clicks a hyperlink on a Web page associated with a compiled client-side program, the user’s
browser must have the ability to run the executable program file; this program interacts with
the user, sending and retrieving data from a database server as needed.

Many times, the user is asked to install certain ActiveX components to view some
animations or play games. This new component plugs in into the existing system, thus
extending the functionality of the system.

Java Applets are another example of compiled programs on client workstations. An


applet is a program written in the Java programming language that can be included in an
HTML page, much in the same way an image is included in a page. When we use a Java
technology- enabled browser to view a page that contains an applet, the applet's code is
transferred to our system and executed by the browser Client-side scripts. In a client- side
script, source code written in such languages as JavaScript and VBScript is embedded in an
HTML document, along with the static HTML text; it is placed within delimiter tags to
indicate to the user’s browser that the text is code that must be interpreted. If the user’s
browser is able to recognize and interpret the code, it is processed. If the browser is unable to
recognize and interpret the code, it is displayed as text on the Web page.

40
Although basic client- side scripts cannot be used by a Web page to interact with a
remote database, they are often used to validate user inputs entered on HTML forms
submitted for processing by a server- side program; for example, a script running on a client
workstation might check the inputs users submit to a Web page to make sure they entered all
required data and appropriate data values. This approach avoids transmitting inputs to the
Web server that are incomplete or include errors, while offloading error checking and
handling from the Web server program to the client workstation.

Client-side scripts can also be used to create advanced Web page features, including:
animations, calculations, playing sound and video, and image maps allowing users to move
their cursors over an image and click to access different Web page links.

JavaScript is the most commonly used client-side scripting language and is supported by
most browsers.

Use of a client-side scripting language depends on the user’s operating system,


browser platforms, and developer expertise. If the Web pages in question are to be accessed
by a variety of users over the Internet, JavaScript is probably better than VBScript, as
JavaScript is the only scripting language able to run on nearly all browsers. If the Web pages
are to be accessed on an intranet and if the organization has standardized on Microsoft’s
browser and Web server, VBScript is a satisfactory scripting language for creating client-
side scripts.

4.8 Web Based Application Development


The Web is built on the HyperText Transfer Protocol. HTTP is a client/server
request/reply protocol that is stateless. That is, the protocol does not make any association
between one transaction and another; e.g.: time since the last transaction, type or client
involved in the last transaction, what data was exchanged between the client and the server.
As far as HTTP is concerned, each transaction is a discrete event. But this is not what we
want in a shopping cart application because we need to preserve the user’s shopping selection
as they proceed with their purchase, in addition it is useful to have the access to their past
purchase history and personal preferences.

Carrying information from one page to another can be achieved by several ways, such as
Cookies, Session variables, Post variables, etc.

41
A cookie is a small file that has a maximum age, a domain and path of applicability,
and a security specification. Any time a server sends a response to a client, it may include one
or more Set-Cookie headers. When a client receives a Set- cookie header, it stores the content
of the header and the cookie, for later use. In our application, every time the client selects an
item to put in the shopping cart, the server can send a Set-Cookie whose content is the ID of
the item, and whose domain and path of applicability are the URL of the order/payment page.
Then, when the user goes to order and pay, the client will send the Cookie headers for each of
the selected items. Upon receiving this request, the server can parse the supplied cookies and
charge the user appropriately for the selected items. Cookies may also be used to identify the
users.

However, cookies are very insecure to use since they are transmitted as plain text and
the server has no control over how cookies are stored in at the client’s side. Another approach
is based on a notion of session ID. These notions provide means for the server to track the
requests of a client through a “session”, but unlike cookies, which are stored on the client,
Session variables are stored on the Server. A session starts when a user logs in and ends when
they log off from the website.

The Session object is used to store information about, or change settings for a user
session. Variables stored in the Session object hold information about one single user, and are
available to all pages in one application. Common information stored in session variables are:
name, id, and preferences. The server creates a new Session object for each new user, and
destroys the Session object when the session expires.

In this project, the concept of session variables will be used for maintaining state information.

4.9 Database Connectivity


In e- commerce applications it is very typical for the Web server to contact the
database to get information as needed. ASP.NET uses a technology called ActiveX Data
Objects.NET (ADO.NET) to connect to the database.

4.9.1 ADO.NET
Classic ASP pages used ActiveX Data Objects (ADO) to access and modify
databases. ADO is a programming interface used to access data. This method was efficient
and fairly easy for developers to learn and implement. However, ADO suffered from a dated
model for data access with many limitations, such as the inability to transmit data so it is
42
easily and universally accessible. Coupled with the move from standard SQL databases to
more distributed types of data (such as XML), Microsoft introduced ADO.NET. Although
ADO.NET is known as the next evolution of ADO, it is very different from its predecessor.
Whereas ADO was connection- based, ADO.NET relies on short, XML message-based
interactions with data sources. This makes ADO.NET much more efficient for Internet-based
applications.

A fundamental change from ADO to ADO.NET was the adoption of XML for data
exchanges. XML is a text- based mark-up language, similar to HTML that presents an
efficient way to represent data. This allows ADO.NET to reach and exchange. It also gives
ADO.NET much better performance because XML data is easily converted to and from any
type of data.

Another major change is the way ADO.NET interacts with databases. ADO requires
“locking” of database resources and lengthy connections for its applications, but ADO.NET
does not; it uses disconnected data sets, which eliminates lengthy connections and database
locks. This makes ADO.NET much more scalable because users are not in contention for
database resources.

In ADO.NET there are two core objects that allow us to work with data initially: the
Data Reader and the Data Set. In any .NET data access page, before we connect to a
database, we first have to import all the necessary namespaces that will allow us to work with
the objects required. Namespace in .NET is a set of classes that can be used while creating an
application. The .NET Framework has about 3,500 classes which can be accessed through a
namespace. The application will be using a technology known as Open Data Base
Connectivity (ODBC) to access the database; therefore we must first import necessary
namespaces. Below is a sample namespace declaration used by .NET.

<%@ Import Namespace="System" %>

<%@ Import Namespace="System.Data" %>

<%@ Import Namespace="System.Data.Odbc" %>

After all the necessary namespaces are imported, a connection to the database is made.

43
OdbcConnetion odbcCon = new OdbcConnection ("DRIVER = {MySQL ODBC
5.6.20Driver}; SERVER=localhost; DATABASE=project;
UID=root; PASSWORD=pwd"); odbcCon.Open();

The above statement creates a connection to the database with an OdbcConnection object.
This object tells ASP.NET where to go to get the data it needs.

Since the data is stored in the same computer as the application, the SERVER is given as
local host. Next we open the connection object. Listed below are the common connection
object methods we could work with:

 Open- Opens the connection to our database


 Close- Closes the database connection
 Dispose- Releases the resources on the connection object. Used to force garbage
collecting, ensuring no resources are being held after our connection is used.
 State- Tells you what type of connection state your object is in, often used to check
whether the connection is still using any resources.

Once the connection is made, in order to access the data in a database, ADO.NET relies on
two components: DataSet and Data Provider [20]. These components are explained below.

DataSet
The dataset is a disconnected, in- memory representation of data. It can be considered as a
local copy of the relevant portions of the database. The DataSet resides in memory and the
data in it can be manipulated and updated independent of the database. If necessary, changes
made to the dataset can be applied to the central database. The data in DataSet can be loaded
from any valid data source such as a text file, an XML database, Microsoft SQL server
database, an Oracle database or MySQL database.

Data Provider
The Data Provider is responsible for providing and maintaining the connection to the
database. A DataProvider is a set of related components that work together to provide data in
an efficient and performance driven manner. Each DataProvider consists of the following
component classes:

 The Connection object which provides a connection to the database


 The Command object which is used to execute a command
44
 The DataReader object which provides a read only, connected recordset
 The DataAdapter object which populates a disconnected DataSet with data and
performs the update.

The Connection Object


The Connection object creates the connection to the database. Microsoft Visual Studio .NET
provides two types of Connection classes: the SqlConnection object, which is designed
specifically to connect to Microsoft SQL Server 7.0 or later, and the OleDbConnection
object, which can provide connections to a wide range of database types like Microsoft
Access and Oracle. The Connection object contains all of the information required to open a
connection to the database.

The Command Object


The Command object is represented by two corresponding classes: SqlCommand and
OleDbCommand. Command objects are used to execute commands to a database across a
data connection. The Command objects can be used to execute stored procedures on the
database, SQL commands, or return complete tables directly. Command objects provide three
methods that are used to execute commands on the database:

ExecuteNonQuery: Executes commands that have no return values such as INSERT,


UPDATE or DELETE.

ExecuteScalar: Returns a single value from a database query

ExecuteReader: Returns a result set by way of a DataReader object

The DataReader Object


The DataReader object provides a read-only, connected stream record set from a database.
Unlike other components of the Data Provider, DataReader objects cannot be directly
instantiated. Rather, the DataReader is returned as the result of the Command object's
Execute Reader method. The SqlCommand.ExecuteReader method returns a SqlDataReader
object, and the OleDbCommand. ExecuteReader method returns an OleDbDataReader object.
The DataReader can provide rows of data directly to application logic when one does not
need to keep the data cached in memory. Because only one row is in memory at a time, the
DataReader provides the lowest overhead in terms of system performance but requires the
exclusive use of an open Connection object for the lifetime of the DataReader.

45
The DataAdapter Object
The DataAdapter is the class at the core of ADO .NET's disconnected data access. It is
essentially the middleman facilitating all communication between the database and a DataSet.
The DataAdapter is used either to fill a DataTable or DataSet with its Fill method. After the
memory-resident data has been manipulated, the DataAdapter can commit the changes to the
database by calling the Update method. The DataAdapter provides four properties that
represent database commands:

Select Command

Insert Command

Delete Command

Update Command

When the Update method is called, changes in the DataSet are copied back to the database
and the appropriate InsertCommand, DeleteCommand, or UpdateCommand is executed.

ADO.NET follows the below process, Figure 17, to connect to the database and retrieve data
to the application [21].

46
Figure 17 ASP.NET APPLICATION

 When an ASP.NET application needs to access the database, it submits an appropriate


request to ADO.NET through a DataAdapter object, which in turn sends a command
to the Connection object.
47
 The Connection object establishes a connection to the database and submits the
request sent by DataAdapter.
 The Connection object connects to the database through a Provider such as
ODBC.NET. The Provider acts as a translator between the Connection object and the
database. It translates the request for data to database’s language and brings back the
data, if needed.
 The Provider sends the data back to the DataAdapter through the Connection object
and DataAdapter places the data in a DataSet object residing in application’s memory.

Instead of storing data in a DataSet, a DataReader can be used to retrieve data from
the database. Results are returned in a resultset which is stored in the network buffer on the
client until a request is made to Read method of the DataReader. Using the DataReader can
increase the application performance by retrieving as soon as the data is available, rather than
waiting for the entire results of the query to be returned [22].

A DataSet can be used to interact with data dynamically such as binding to a Web
Form, cache locally in the application, provide hierarchical XML view of the data, etc. If
such functionalities are not required by the application, a DataReader can be used to improve
the performance of the application. By using a DataReader, the memory can be saved that is
used by the DataSet, as well as the processing required to fill the contents of a DataSet.

When a DataReader is used, a DataAdapter is not required to send the data to the application.
In this project, DataReader is used to read the data and Command object called
ExecuteNonQuery is used to write into the database.

4.9.2 Connecting ASP.NET application to a Database


The steps required to connect our ASP.NET application to the MySQL database and access
the data are given below:

1. Import the required namespaces.

using System;

using System.Data;

using System.Data.Odbc;

2. Create a connection object.

48
string myConnectionString;

myConnectionString = “DRIVER = {MySQL ODBC 3.51 Driver}; SERVER =

localhost; DATABASE = project; UID = root; PASSWORD = ‘’”

OdbcConnection odbcCon = new odbcConnection(myConnectionString)

3. Create a SQL query

string str;

str="Select * from Customer where UserID='admin’;

4. Create a Command object to run the SQL query

odbcCmd = new OdbcCommand(str,odbcCon);

5. DataReader to read the result

OdbcDataReader odbcReader;

String text, text2;

while (odbcReader.Read( ) )

text = odbcReader["UserID"].ToString( );

text2 = odbcReader[“FirstName”].ToString( );

6. Close odbcReader and odbcConnection

odbcReader.Close ( );

odbcCon.Close ( );

The data can now be used as desired by the application.

49
4.10 The Shopping Cart Application
The objective of this application is to provide the user an online website where they
can buy books from the comfort of their home. A shopping cart is used for the purpose. The
user can select the desired books, place them in the shopping cart and purchase them using a
Credit Card. The user’s order will be shipped according to the type of shipping selected at the
time of placing the order.

Website consists of the following web pages:

1. AddBook.aspx

2. BookDetails.aspx

3. BookReview.aspx

4. Books.aspx

5. ChangePassword.aspx

6. CheckOut.aspx

7. FinalOrder.aspx

8. Footer.ascx

9. ForgotPassword.aspx

10. Login.aspx

11. LogOff.aspx

12. Menu.ascx

13. Order.aspx

14. PurchaseHistory.aspx

15. Registration.aspx

16. Search.aspx

17. ShoppingCart.aspx

50
18. UserDetails.aspx

Below figures show some screenshots taken from running the application. All the
functionalities are explained accordingly.

When the user types the web address in the browser, the main page of the application is
displayed which has the list of the top ten popular books available in the store, as shown in
Appendix 2 Figure 1.

The information about books is stored in “Books” table. The user can know the ISBN of the
book, book title, author of the book, number of copies available at the store, price of the
book. A link to add the book to the shopping cart and also a link to write a review for the
book are also provided. The user does not have to login to add a book to the cart or to
read/write a review.

4.10.1 Search for Books


Books can be searched based on the ISBN, Title or the Author of the book. When
searching for books by author “Jesse Liberty”, two books are displayed as shown in
Appendix 2 Fig 2.

4.10.2 Registration
A new user can register on the site by clicking on the registration button on the menu
at the top of the page, as shown in Appendix 2 Fig 3.

The “*” beside the label indicates the required field for successful registration on the site. If
the value if not entered, an appropriate message is displayed. If a user with same UserID
already exists, the message is displayed. Clicking on Reset will clear all the fields and Submit
will submit the information for registration. Upon successful completion, the user is directed
to the Books page.

4.10.3 User Details


On clicking “User Details”, the detailed profile information of the user who is
currently logged in is displayed as shown in Appendix 2 Fig 4.

Here the users can change their profile except for the UserID and these details will be
reflected in the database only when the Update button is clicked. If the user has placed any
order previously, those details can be viewed by clicking on the Purchase History button.

51
4.10.4 Shopping Cart
When “Add to Cart” is clicked for any book, it is added to the shopping cart
illustrated in Appendix 2 Fig 5. If that particular book is already present in the shopping cart,
the quantity is increased by 1 and the price is changed accordingly; if not, a new entry is
made into the table. All the information in the shopping cart is stored in
“shopping_cart_items” table. Adding a book into the shopping cart does not decrease the
quantity of books in the Books table. It is decreased only after an order is placed for the book.
So, placing the book in the shopping cart does not guarantee the availability of the book at the
time of placing the order.

4.10.5. Place an Order


When “Place an Order” button is clicked which is located on the bottom of the
shopping cart, the application will ask the user to login if he has not already done so.

If the user is placing an order with the web site for the first time, they will be asked to
enter the credit card details as shown in the above figure; if not, only the Card Verification
Value (CVV) number of the credit card is asked for verification, as shown in Appendix2
Figure 6.

At this point, the user can check the shipping address box if shipping address is same
as billing address, otherwise the user has to enter the new shipping address as shown in
Appendix2 Figure 7.

If the check box provided is checked, the shipping address is obtained from the Customer
table. The user also has to select the desired type of shipping for the order. When all the
information is entered, the user can “Proceed to the Checkout”.

4.10.6. Check Out


Before placing the final order, the user is shown the total price of the order, which
includes total price of books selected, shipping rate and state tax as illustrated in Appendix2
Figure 8. If the user is not satisfied with the order, the order can be cancelled at that point.
The information in the shopping cart remains intact, so the user can go back to it and make
any changes if necessary. When the “Place Order” button is clicked, the order is placed and
the following screen appears which informs the user about the approximate number of days in
which the order will be delivered.

52
Once the order is placed, the quantity of the books is reduced in the Books table. The
shopping cart for the user cleared and an appropriate message is displayed, as shown in
Appendix 2 Figure 9.

The inventory is updated as shown in Appendix2 Figure 10 after the order is placed.

4.10.7. Purchase History


Appendix 2 Figure 11 details the purchase history of the user “yuscodguy”. Purchase
history can be reached by clicking on the “Purchase History” tab on “User Details” screen as
shown in the Appendix 2 Fig 4

When viewing the purchase history, the user can view the details of each book by clicking on
the book name. The details are displayed as shown in Appendix2 Figure 12.

Book information can only be changed by the Administrator of the site. All other users can
only view the details of the books. The administrators of the site can also “Add Book” or
“Remove Book” to/from the Books table. Appendix 2 Figure 13 allows a book modification
form accessible to the administrator.

In order to add a book, the administrator will enter the ISBN of the book. If the ISBN is
already present in the Books table, the administrator is asked to enter the quantity of the
books.

If the entered ISBN book is not present in the Inventory, the administrator is asked to enter
the details about the book as shown in Appendix 2 Figure 14 to add the book to the inventory.

Appendix 2 Figure 15 shows the updated inventory after the book details in Appendix 2
Figure 14 are entered.

When a user logs off the website, the items in their Shopping Cart are cleared. When the user
enters a password during the registration, it is encrypted before it is stored in the database. It
is a one-way encryption and the original form cannot be retrieved again. Similar encryption
method is used for Credit Card Number.

Suppose there are only three “Programming C#” books available in the store. One
user adds all of them to the shopping cart, and by the time he chooses other books and places
the order, another user has already placed an order for two of those books. In that case, the

53
first user comes to know about this at the time of placing the order and he is directed to the
shopping cart to make the appropriate changes.

As explained earlier, the user need not be logged in to add books to the shopping cart. When
the user adds books without logging in, a GUID (Globally Unique Identifier) is obtained from
the system and stored in Session ["login id”] variable. This GUID is stored in the
shopping_cart_items table along with the selected books by the user. If the user logs in, the
GUID in the table is replaced with the actual UserID of the user.

Session variables are used to transfer data from one page to another. As soon as the user
closes the window, the session variables are cleared.

4.10.8 Transactions in the Application


A transaction is a group of database commands that are treated as a single unit.
Transaction must pass what is known as the ACID test:

Atomic: All operations in the transaction are executed properly or none. In other words, they
make up a single unit of work. For example, if a customer moves and a transaction is used to
reflect that change in the database, all parts of the address (street, city, state, etc) must be
changed as an atomic action, rather than changing street, then city, then state, and so on.

Consistent: The execution of a single transaction preserves the consistency of the database.
All the relationships between data in a database are maintained correctly. For example, if
customer information uses a tax rate from a state tax table, the state entered for the customer
must exist in the state tax table.

Isolation: Each transaction is unaware of the other transactions occurring concurrently.


Changes made by other clients cannot affect the current changes. For example, if two data
entry operators try to make a change to the same customer at the same time, one of two things
occurs: either one operator's changes are accepted and the other is notified that the changes
were not made, or both operators are notified that their changes were not made. In either case,
the customer data is not left in an indeterminate state.

Durability: Changes the transaction has performed persist in the database. Once a change is
made, it is permanent. If a system error or power failure occurs before a set of commands is
complete, those commands are undone and the data is restored to its original state once the
system begins running again.

54
Transaction processing is particularly important for Web applications that use data
access, since Web applications are distributed among many different clients. In a Web
application, databases are a shared resource, and having many different clients distributed
over a wide area can present these key problems:

 Contention for resources. Several clients might try to change the same record at the
same time. This problem gets worse the more clients you have.
 Unexpected failures. The Internet is not the most reliable network, even if your Web
application and Web server are 100 percent reliable. Clients can be unexpectedly
disconnected by their service providers, by their modems, or by power failures.
 Web application life cycle. Web applications do not follow the same life cycle as
Windows applications —Web forms live for only an instant, and a client can leave
your application at any point by simply typing a new address in their browser.

Transaction processing follows these steps:

1. Begin a transaction.

2. Process database commands.

3. Check for errors.

4. If errors occurred, restore the database to its state at the beginning of the transaction.
If no errors occurred, commit the transaction to the database.

Suppose two users try to add the same book to the shopping cart and try to place an
order at the exact same time. An update should be done to the Books table after the order is
placed, but if only the latest transaction is noted down, the book quantity will differ in the
real world. This situation has to be handled as in a “Transaction”. As detailed earlier, a
transaction is an operation or set of operations that succeeds or fails as a logical unit. That is,
either both the updates are not done, or both the updates are done consecutively.

Transactions are normally managed by declaring boundaries around a set of


operations. Operations that execute in the context of the transaction boundary then succeed or
fail as a unit. For ASP.NET, the transaction boundary is the execution of a single request to a
page, which might contain nested components that participate in the same transaction. While
the page is executing, if an operation on the page itself or a nested component in the same

55
transaction fails, it can call ContextUtil.SetAbort. This is then picked up by the current
transaction context, the entire transaction fails, and any operations that were already
completed are undone. If nothing fails, the transaction is committed.

ASP.NET support for transactions consists of the ability to allow pages to participate
in ongoing Microsoft .NET Framework transactions. Transaction support is exposed via an
@Transaction directive that indicates the desired level of support:

<%@ Transaction="Required" %>

Table 2 defines the supported transaction attributes. The absence of a transaction directive is
the same as an explicit directive to "Disabled".

Table 2 Transaction attributes


Attribute Description

Required The page requires a transaction. It runs in the context of an


existing transaction, if one exists. If not, it starts one.

RequiresNew The page requires a transaction and a new transaction is started


for each request.

Supported The page runs in the context of an existing transaction, if one


exists. If not, it runs without a transaction.

The page does not run within the scope of transactions.

NotSupported When a request is processed, its object context is created


without a transaction, regardless of whether there is an active
transaction.

A transaction can be explicitly committed or aborted using static methods of the


System.EnterpriseServices.ContextUtil class. You can explicitly call the SetComplete or
SetAbort method to commit or abort an ongoing transaction.

A transaction will commit or abort at the end of the page's lifetime depending on whether
SetComplete or SetAbort was called last, provided there is no other object to join the same
transaction.

56
4.11 Limitations and Future Development
There are some limitations for the current system to which solutions can be provided as a
future development:

1. The system is not configured for multi- users at this time. The concept of transaction
can be used to achieve this.
2. The Website is not accessible to everyone. It can be deployed on a web server so that
everybody who is connected to the Internet can use it.
3. Credit Card validation is not done. Third party proprietary software can be used for
validation check.

In future developments, the following can be done:

1. The Administrator of the web site can be given more functionalities, like looking at a
specific customer’s profile, the books that have to be reordered, etc.
2. Multiple Shopping carts can be allowed.

57
CHAPTER 5
5.0 Summary of Result
The primary aim of this project has been met. All the objectives that were set out have
been completed and giving positive results in the end.

Although some users comment that they did not think shopping online was ideal, it has
managed to convince them to try in the future.

In Nigeria, the e-Commerce ecosystem is a huge reality and is a catalyst for economic
growth in the country. Indeed, e-Commerce gives to Nigerian businesses the possibility to
significantly extend the reach of wholesale and retail trade in the country, which leads to a
boost of profits and job creation.

People in Nigeria commonly use e-commerce sites to buy and sell second items
online through free-classifieds sites like this one, which reveals an economical growth and
improvement within individuals and not only large companies.

Oil, mineral and human resources and the population of people in millions are over 160
million potential buyers and sellers of different items on every street. The thing that makes e-
Commerce so successful in Nigeria is that Nigerians love to shop, but there’s an absence of a
well-structured retail chain, too few shopping malls and poor transportation network, which
makes it difficult to access the product. And that’s where the e-Commerce comes in handy.

According to Euromoney International, online sales in Nigeria have multiplied between 2011
and 2012 from $10.5 million to about $3 billion, making e-Commerce the country’s second-
biggest economy. This is also because what looks like a simple internet transaction includes,
between the online order and the final delivery, a series of Nigerian business realities, such as
the financial services sector, the transport sector, the postal sector and the telecommunication
sector. What works against this incredible economic resource is an inadequate broadband
access, the high cost of internet and mobile communications services, a low awareness
among the public of the relevance of such type of commerce to their lives, a low consumer
confidence in using electronic payment channels and a low availability of skilled personnel
among others.[46]

58
5.1 Conclusion
The Internet has become a major resource in modern business, thus electronic
shopping has gained significance not only from the entrepreneur’s but also from the
customer’s point of view. For the entrepreneur, electronic shopping generates new business
opportunities and for the customer, it makes comparative shopping possible. As per a survey,
most consumers of online stores are impulsive and usually make a decision to stay on a site
within the first few seconds. “Website design is like a shop interior. If the shop looks poor or
like hundreds of other shops the customer is most likely to skip to the other site” [16]. Hence
we have designed the project to provide the user with easy navigation, retrieval of data and
necessary feedback as much as possible.

In this project, the user is provided with an e-commerce web site that can be used to
buy books online. To implement this as a web application we used ASP.NET as the
Technology. ASP.NET has several advantages such as enhanced performance, scalability,
built- in security and simplicity. To build any web application using ASP.NET we need a
programming language such as C#, VB.NET, J# and so on. C# was the language used to
build this application. For the client browser to connect to the ASP.NET engine we used
Microsoft’s Internet Information Services (IIS) as the Web Server. ASP.NET uses ADO.NET
to interact with the database as it provides in- memory caching that eliminates the need to
contact the database server frequently and it can easily deploy and maintain an ASP.NET
application. MySQL was used as back-end database since it is one of the most popular open
source databases, and it provides fast data access, easy installation and simplicity.

A good shopping cart design must be accompanied with user- friendly shopping cart
application logic. It should be convenient for the customer to view the contents of their cart
and to be able to remove or add items to their cart. The shopping cart application described in
this project provides a number of features that are designed to make the customer more
comfortable.

This project helps in understanding the creation of an interactive web page and the
technologies used to implement it. The design of the project which includes Data Model and
Process Model illustrates how the database is built with different tables, how the data is
accessed and processed from the tables. The building of the project has given me a precise
knowledge about how ASP.NET is used to develop a website, how it connects to the database

59
to access the data and how the data and web pages are modified to provide the user with a
shopping cart application.

5.2 Recommendation
From this study, a shopping centre website providing online market and web site package
under the same domain, is successfully implemented.
Using the principle of content management, online market provides all functions
which customers need for conducting online shopping. Furthermore, the website package
service well known among online store owners is convenient and flexible for any potential
users. For website development open source software is mostly used due to its low cost of
development. Provided services are likewise relatively low in price and suitable for online
market. This website also promotes e-commerce and online marketing on the Internet,
complying with the information technology policy of the government. Regarding website
quality, implementing various techniques of web design and database management system
coupled with other additional services, the website is quite responsive.
Moreover, to obtain the highest system performance, it utilizes full options of both
hardware and operating system software. With all mentioned techniques, the website operates
with low resource consumption at its massive size. This website will expand e-commerce
business to cover most of available Internet devices and technology, such as mobile phone,
mobile payment, wireless application protocol and pocket personal computer.

60
Reference

1. "The Alibaba phenomenon". The Economics. March 23, 2013.


2. 1982 Videotex Communications, Collected Papers Aldrich Archive, University of
Brighton December 1982 
3. 1980 TV paves the way for Information Brokerage, Minicomputer News p. 12 London
May 1980, the most comprehensive report of the March 1980 Press Conference
launching the Redifon R 1800/50 computer system. Is 'Information Brokerage' aka
'browser industry'?
4. 2011 M. Aldrich 'Online Shopping in the 1980s' IEEE 'Annals of the History of
Computing' Vol 33 No4 pp57-61 October–December 2011 ISSN 1058-6180 
5. 1980 Checking on the check-outs, Financial Times London 12 July 1980
6. Palmer, Kimberly.(2007) News & World Report.
7. Bigne, Enrique (2005). "The Impact of Internet User Shopping Patterns and
Demographics on Consumer Mobile Buying Behavior". Journal of Electronic
Commerce Research 6.
8. "More Consumers Using Tablets to Holiday Shop [STUDY]". Mashable. December
8, 2011.
9. PCI Security Standards Council. "PCI Data Storage Do’s and Don’ts". Retrieved 24
March 2013.
10.Lopresti, Michael (September 1, 2007). "Bill-2-Phone Lets Customers Add Online
Purchases to Their Phone Bill". Allbusiness.com. Retrieved 23 November 2010.
11.Geena Rao (July 19, 2010). "Mopay Now Allows You To Bill Mobile Payments To A
Landline Account". TechCrunch.com. Retrieved 23 November 2010.
12.Walker, John (2007-11-22). "RPS Exclusive: Gabe Newell Interview". Rock, Paper,
Shotgun. Retrieved 2013-06-28. "The worst days [for game development] were the
cartridge days for the NES. It was a huge risk – you had all this money tied up in
silicon in a warehouse somewhere, and so you’d be conservative in the decisions you
felt you could make, very conservative in the IPs you signed, your art direction would
not change, and so on. Now it’s the opposite extreme: we can put something up on
Steam, deliver it to people all around the world and make changes. We can take more
interesting risks. Retail doesn’t know how to deal with those games. On Steam [a

61
digital distributor] there’s no shelf-space restriction. It’s great because they’re a
bunch of old, orphaned games."
13.Jarvenpaa, S. L., & Todd, P. A. (1997). Consumer reactions to electronic shopping on
the World Wide Web. International Journal of Electronic Commerce, 1, 59–88.
14.Peterson, R. A., Balasubramanian, S., & Bronnenberg, B. J. (1997). Exploring the
implications of the Internet for consumer marketing. Journal of the Academy of
Marketing Science, 25, 329–346.
15.Stephen F. King en Juhn-Shiuan Liou, "A framework for internet channel evaluation",
International Journal of Information & Management 24 (2004), 473–488
16. Mehrabian, A., & Russel J.A. (1974) An Approach to Environmental Psychology.
Cambridge, MA: The MIT Press.
17. Huang, M. (2000) Information load: its relationship to online exploratory and
shopping behavior. International Journal of Information Management 20: 337–347.
18. Campbell, D.J. (1988) Task complexity: A review and analysis. Academy of
Management Review, 13(1), 40–52.
19. Jump up to:a b c d Falk, Louis K.; Sockel, Hy; Chen, Kuanchin. (2005) "E-Commerce and
Consumer's Expectations: What Makes a Website Work." Journal of Website
Promotion, 1(1) (65–75)
20. Ram L. Kumar et al., "User interface features influencing overall ease of use and
personalization", Information & Management 41 (2004): 289–302
21. Steve Elliot and Sue Fowell, "Expectations versus reality: a snapshot of consumer
experiences with Internet retailing", International Journal of Information Management
20 (2000): 323–336
22. Sherry Y. Chen en Robert D. Macredie, "The assessment of usability of electronic
shopping: A heuristic evaluation", International Journal of Information Management
25 (2005), 516–532
23. "Forrester Research, Understanding Online Shopper Behaviors, US 2011, May 17,
2011".
24. NPD
25. National Retail Federation survey
26. "Forrester: Online Retail Industry In The US Will Be Worth $279 Billion In
2015".TechCrunch. February 28, 2011.

62
27. "China's Internet users reach 564 mln". news.xinhuanet.com. 2013-01-15. Retrieved
January 15, 2013.
28. "A guide for businesses on distance selling". Office of fair trading. 2004. Retrieved 19
March 2014.
29. Denise J., Deveau (01/14/10). "Keeping It Real for Cross-Border Online
Shoppers".ecommercetimes.com. ECT News Network. Retrieved 19 March 2014.
30. Nielsen, "Online Shopping Trends", (USA: The Nielsen Company, 2010)
31. By Bonsoni.com on July 10, 2011 (2011-07-10). "Research shows word of mouth
drives online sales". Bonsoni.com. Retrieved 2012-01-19.
32. "Nielsen Global Online Shopping Report". Blog.nielsen.com. 2010-06-29. Retrieved
2012-01-19.
33. By Marketingland.com on July 9, 2012 (2012-06-09). "Infographic: What We Do
Online". Marketingland.com. Retrieved 2013-06-14.
34. Wallace, Craig (September 26, 2013). "Sparkling Jewellery At Goldsmiths Online".
Newswire.

35. http://www.businessdictionary.com/definition/electronic-commerce-E-
Commerce.html#ixzz38CGIcZ5w 25 July, 2014.

36. Nancy May Kay Leung, (17 December 2003). Demonstrating That With Better
Interaction Features In Clothing Web Sites May Improve Sales Over The Internet.

37. Chen, L. (2000). Enticing Online Consumers: A Technology Acceptance Perspective


Research- in-Progress. ACM Proceedings, SIGCPR.
38. Diwakar, H., Marathe, M. (2000). The architecture of a one- stop web- window shop.
December, ACM SIGecom Exchanges, Volume 2 Issue 1.
39. Morrison, M., Morrison, J., and Keys, A. (2002). Integrating Web Sites and
Databases. Communications of the ACM, September, Volume 45, Issue 9.
40. Kubilus, N. J. (2000). Designing an e-commerce site for users. September 2000,
Crossroads, Volume 7 Issue 1.
41. Norman, D.A. The Design of Everyday Things. Doubleday, New York, 1994.
42. Tilson, R., Dong, J., Martin, S., Kieke, E. (1998). A comparison of two current e-
commerce sites. September, Proceedings of the 16th annual international conference
on Computer documentation.
43. The significance for retailers to having a web site Murphy, 1998

63
44. Pastore, M. (2000) Online Apparel Shopping Gaining in Popularity, CyberAtlas Search.
45. Greenspan, R (2003) Apparel Sales Apparent Online, CyberAtlas Search,
http://cyberatlas.internet.com/markets/retailing/print/0,,6061_2171361,00.html
46. The heralding website, September 2014. http://www.theheraldng.com/e-commerce-
development-nigeria/
47. Anderson, R., Francis, B., Homer, A., Howard, R., Sussman, D. and Watson.(2001)
Professional ASP.NET. Wrox Press Ltd.
48. Brown, S., Burd ick, R., Falkner, J., Galbraith, B., Johnson, R., Kim, L., Kochmer, C.,
Kristmundsson, T. and Li S (2001). Professional JSP. Wrox Press Ltd.
49. Walther, S. (1998) Active Server Pages. SAMS Net.
50. Wagner, R., Daniels, K., Griffin, G., Haddad, C. and Nasr, J. (1997) JavaScript
Unleashed. SAMS Net.
51. Wiley, Y. M. J. & Sons. (1997) Creating the Virtual Store: Taking Your Web Site
from Browsing to Buying.
52. http://encyclopedia.laborlawtalk.com/IIS for information on IIS
53. http://aspnet.4guysfromrolla.com/articles/020404- 1.aspx for relationship between IIS
and ASP.NET.
54. http://216.15.201.66/dpec/course.htm?fullpg=http
%3A//216.15.201.66/dpec/courses/wac312/wah006.htm&acro=wac312 for security
authentication in ASP.NET
55. http://samples.gotdotnet.com/quickstart/aspplus/doc/mtstransactions.aspx for
information on Transactions in ASP.NET.
56. http://x- cart.com/articles/design_development.html for online customer behaviour.
57. http://aspnet.4guysfromrolla.com/articles/011404- 1.aspx for relation between IIS and
ASP.NET.
58. http://www.informatik.uni- bremen.de/uniform/gdpa_d/methods/m- fctd.html for
definition of Functional Decomposition.
59. http://www.agilemodeling.com/artifacts/dataFlowDiagram.html for definition of Data
Flow Diagram.
60. http://www.startvbdotnet.com/ado/default.aspx for information on ADO.NET
61. http://mypage.iusb.edu/~hhakimza/505/index.html for ADO.NET objects
62. http://msdn.microsoft.com for ADO.NET objects.

64
Appendix
Appendix 1

1. Menu

2. Display of goods present in the store

3. For searching the books in the store

65
4. Shopping cart for user

66
5. Registration of the new user

67
6. Authentication of the user

68
7. Relation between IIS and ASP.NET

69
Appendix 2

1. Details of goods present in the store

2. Search for books

70
3. New user registrations

71
4. User details

5. Shopping cart

6. Order Details
72
7. Shipping details

8. Check out
73
9. Order Confirmation

74
10. Updated inventory after order placement

11. Purchase History

12. Product details

75
13. Administrator - Modify Products

14. Details about new product

15. Updated Inventory

76
77

Вам также может понравиться