an assessment of design patterns' influence on a java based e-commerce application

56
DEPARTMENT OF INFORMATION TECHNOLOGY MCT’S Rajiv Gandhi Institute of Technology JuhuVersova Link Road, Andheri (W), Mumbai400 053. A SYNOPSIS ON An Assessment of Design Patterns' Influence on a Javabased ECommerce Application UNIVERSITY OF MUMBAI NOV – 2012

Upload: abishay-rao

Post on 01-Mar-2016

216 views

Category:

Documents


0 download

DESCRIPTION

An educational project work to assess the effects of Design Patterns on an e-commerce application.

TRANSCRIPT

Page 1: An assessment of Design Patterns' Influence on a Java based e-commerce application

 

 

 

 

DEPARTMENT  OF  INFORMATION  TECHNOLOGY  MCT’S  Rajiv  Gandhi  Institute  of  Technology  

Juhu-­‐Versova  Link  Road,  Andheri  (W),  Mumbai-­‐400  053.  

 

 

 

 

 

 

A  SYNOPSIS  ON    

An  Assessment  of  Design  Patterns'  Influence  on  a  Java-­‐based  

E-­‐Commerce  Application    

 

 

 

 

 

 

 

 

UNIVERSITY  OF  MUMBAI  

NOV  –  2012  

Page 2: An assessment of Design Patterns' Influence on a Java based e-commerce application

A"SYNOPSIS"ON""

An#Assessment#of#Design#Patterns'#Influence#on#a#Java7based#

E7Commerce#Application#""

"BY"Rinckle Gohil 716

Abha Molri 733

Abishay Rao 745

Rohith Rao 746

""

Under"the"guidance"of"Internal"Guide"Prof.&A.&E.&Patil&

"

"DEPARTMENT"OF"INFORMATION"TECHNOLOGY"

MCT’S"Rajiv"Gandhi"Institute"of"Technology"JuhuIVersova"Link"Road,"Andheri"(W),"MumbaiI400"053."

"UNIVERSITY"OF"MUMBAI"

NOV"–"2012"

Page 3: An assessment of Design Patterns' Influence on a Java based e-commerce application

" " ii"

"CERTIFICATE

DEPARTMENT"OF"INFORMATION"TECHNOLOGY""

THIS"IS"TO"CERTIFY"THAT"Rinckle Gohil 716

Abha Molri 733

Abishay Rao 745

Rohith Rao 746

"have"satisfactorily"completed"this"synopsis"entitled"

An#Assessment#of#Design#Patterns'#Influence#on#a#Java7based#E7

Commerce#Application##

towards"the"partial"fulfillment"of"the"BACHELOR"OF"ENGINEERING"[B.E]"

IN"INFORMATION"TECHNOLOGY"

as"laid"by"the"University"of"Mumbai.""

Guide" " " " " " " """"""""""H.O.D"Prof.&A.&E.&Patil" " " " " """"""""Prof.&D.&M.&Dalgade"

"Principal"

Dr.&Udhav&Bhosle&

"Internal"Examiner" " " " " """""""""""External"Examiner"

Page 4: An assessment of Design Patterns' Influence on a Java based e-commerce application

" " iii"

ACKNOWLEDGEMENT

We wish to express our sincere gratitude to Dr. U. V. Bhosle, Principal and

Prof. D. M. Dalgade, H.O.D of Information Technology Department of RGIT for

providing us an opportunity to do our project work on “An Assessment of Design

Patterns' Influence on a Java-based E-Commerce Application ".

This project bears on imprint of many people. We sincerely thank our project

guide Prof. A. E. Patil for his guidance and encouragement in the successful

completion of our project synopsis. We would also like to thank our staff members

for their help in carrying out this project work.

Finally, we would like to thank our colleagues and friends who helped us in

completing the project synopsis successfully.

Rinckle Gohil 716

Abha Molri 733

Abishay Rao 745

Rohith Rao 746

Page 5: An assessment of Design Patterns' Influence on a Java based e-commerce application

"

" " iv"

ABSTRACT

E-commerce had made its mark at the turn of the century and has grown

rapidly since. But why have only some ventures been successful while others

drowned in this dotcom1 era?

Design Patterns! Making a long haul from Civil Engineering2, all the way

into Software Engineering, Design Patterns have given software designers

comprehensive solutions to solving simple end-user problems.

The project work involves the studying of the effect of well-established

design patterns, such as Model View Controller, Front Controller, Easy Undo and

Cross-selling & Up-selling, applies them to a base e-commerce application

developed using the Java EE Platform and measures the differences in performances

using sophisticated Software Metrics, also while measuring improvements in User

Experience31

""""""""""""""""""""""""""""""""""""""""""""""""""""""""1!The!boom!of!Internet!business!is!commonly!referred!to!as!the!dotcom!era.!2"Design!Patterns!were!first!thought!of!as!a!solution!to!common!Civil!Engg.!Problems!by!Christopher!Wolfgang!Alexander.!3"User!Experience!can!only!be!“felt”!by!the!endDuser.!

Page 6: An assessment of Design Patterns' Influence on a Java based e-commerce application

"

" " v"

TABLE OF CONTENTS

1. INTRODUCTION& 1"1.1." """SCOPE& 1"1.1.1." INCLUDES" 1"1.1.2. EXCLUDES" 1"1.2. SUBJECT AREA OVERVIEW& 2"1.2.1. SOFTWARE ENGINEERING" 2"1.2.2. DESIGN PATTERNS" 2"2. AIMS AND OBJECTIVES& 4"3. LITERATURE SURVEY& 5"4. EXISTING SYSTEM& 7"4.1. YUVABAZAAR.COM – AN OVERVIEW& 7"5. PROBLEM STATEMENT & SCOPE& 11"6. PROPOSED SYSTEM& 12"7. METHODOLOGY& 15"7.1. DESIGN PATTERNS& 16"7.1.1. MODEL VIEW CONTROLLER (MVC) PATTERN" 16"7.1.2. FRONT CONTROLLER PATTERN" 18"7.1.3. EASY UNDO PATTERN" 19"7.1.4. CROSS SELLING & UP SELLING PATTERN" 20"7.2. SOFTWARE METRICS& 22"7.3. HYPERTEXT MODELING& 23"8. ANALYSIS& 25"9. DETAILS OF HARDWARE AND SOFTWARE& 26"9.1. SOFTWARE DETAILS& 26"9.2. HARDWARE DETAILS& 26"10. DESIGN DETAILS& 27"11. IMPLEMENTATION PLAN& 32"11.1. METRICS RELEVANT TO E-COMMERCE APPLICATION& 32"11.2. GANTT CHARTS& 34"

Page 7: An assessment of Design Patterns' Influence on a Java based e-commerce application

"

" " vi"

LIST OF FIGURES

FIGURE 4.1: Class Diagram for www.yuvabazaar.com..........................................10

FIGURE 7.1: Structure of MVC pattern...................................................................17

FIGURE 7.2: MVC pattern example........................................................................18

FIGURE 7.3: Screenshot of www.amazon.com.......................................................20

FIGURE 7.4: Screenshot of www.carvihotel.com....................................................21

FIGURE 7.5: Screenshot of www.agacistore.com...................................................22

FIGURE 7.6: Hypertext model for a Shopping Cart Module..................................24

FIGURE 10.1: Class Diagram..................................................................................27

FIGURE 10.2: Use Case Diagram...........................................................................28

FIGURE 10.3: Sequence Diagram...........................................................................29

FIGURE 10.4: Collaboration Diagram....................................................................30

FIGURE 10.5: Activity Diagram showing navigation pattern of the application....31

FIGURE 11.1: Gantt chart 1.....................................................................................35

FIGURE 11.2: Gantt chart 2.....................................................................................35

Page 8: An assessment of Design Patterns' Influence on a Java based e-commerce application

"

" " vii"

LIST OF TABLES

TABLE 3.1: GoF Classification of Design Patterns...................................................6

TABLE 8.1: Difference between the existing and proposed application..................25

TABLE 11.1: Gantt chart table.................................................................................34

Page 9: An assessment of Design Patterns' Influence on a Java based e-commerce application

"

" " viii"

ACRONYMS USED

i. GoF – Gang of Four [Book on Design Patterns]

ii. Java EE – Java Enterprise Edition

iii. CORBA – Common Object Request Broker Architecture

iv. B2C Model – Business to Consumer Model

v. COD – Cash-on-Delivery

vi. MVC – Model-View-Controller

vii. HTML – HyperText Markup Language

viii. EJB – Enterprise Java Beans

ix. CBO – Coupling Between Objects

x. CM – Changing Methods

xi. ChC – Changing Classes

xii. LCOM – Lack of Cohesion in Methods

xiii. UI – User Interface

xiv. IDE – Integrated Development Environment

xv. CMS – Content Management System

xvi. JPA – Java Persistence API1

xvii. EAS – Enterprise Application Server

xviii. GB – Giga Byte

xix. RAM – Random Access Memory

xx. GHz – Giga Hertz

xxi. HTTP – HyperText Transfer Protocol

xxii. SSL – Secure Socket Layer

""""""""""""""""""""""""""""""""""""""""""""""""""""""""1"Application#Programming#Interface"

Page 10: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 1

Page 11: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 1#"

INTRODUCTION

1.1. Scope To understand the scope of this project, let’s divide it under two categories:

1.1.1. Includes The proposed e-commerce application is entirely based on Java, and hence

includes the use of core-Java architecture. It also includes several1 add-on Java

frameworks, which are not mandatory, but shall be used to enhance the real-world

performance of the application. The finally deployed application will make use of

well-established Design Patterns2 in the Software Industry, often used as “best

practices”, especially within the field of our application, “E-Commerce”. Since the

main idea behind this project is to analyze the differences that Design Patterns can

make, we will use clearly defined3 parameters from sophisticated Software Metrics,

also often used as “best practices”. The basic form of comparison between the

derived values for the parameters shall be the most popular ‘tabular’ format.

However, because numbers may fail4 beyond a point, we will also graphically plot

the results in a way that the educated non-expert easily comprehends the benefits

and/or drawbacks of Design Patterns. Also, we may include the use of several open

source tools and/or applications, as the need arises.

1.1.2. Excludes Since the motivation of the proposed e-commerce application is to

understand the impact of Design Patterns, and given the time frame of about 15

weeks5, it is not realistic to expect a full-fledged marketplace that will host hundreds

of catalog items. We shall instead measure the parameters on fewer items that will

give us a better understanding. Also, we do not mean to make any attempt at

classifying design patterns according to usage, which demands a separate study for

""""""""""""""""""""""""""""""""""""""""""""""""""""""""1"The!frameworks!are!defined!in!Chapter!9."2"Details!regarding!the!Design!Patterns!are!discussed!in!Chapter!7."3"Same!as!Citation!1"4"“A!picture!is!worth!a!thousand!words”,!a!famous!adage."5"This!is!only!considering!the!implementation!time!frame."

Page 12: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 2#"

itself. We will only use limited features of the add-on Java frameworks that is

mentioned in the previous sub-section, and that will only include features that are

critical to achieve certain functionalities within the scope of this project.

1.2. Subject Area Overview Since this report talks a lot about specific topics of interest, this section will

throw some light upon the subject areas that come under the scope of this paper.

1.2.1. Software Engineering Software Engineering (SE) is the application of a systematic, disciplined,

quantifiable approach to the design, development, operation, and maintenance

of software, and the study of these approaches; that is, the application

of engineering to software.

The tasks performed by software engineers evolve quickly, reflecting new

areas of specialization or changes in technology, as well as the preferences and

practices of employers. Computer software engineers apply the principles and

techniques of computer science, engineering, and mathematical analysis to the

design, development, testing, and evaluation of the software and systems that enable

computers to perform their many applications. Software engineers working in

applications or systems development analyze users' needs and design, construct, test,

and maintain computer applications software.

Software engineers can be involved in the design and development of many

types of software, including software for operating systems and network

distribution. Software engineering not only involves the use of strong programming

skills, but also involves developing strong algorithms.

1.2.2. Design Patterns In software engineering, a design pattern is a general reusable solution to a

commonly occurring problem within a given context in software design. A design

pattern is not a finished design that can be transformed directly into source or

machine code. It is a description or template for how to solve a problem that can be

used in many different situations. Patterns are formalized best practices that the

Page 13: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 3#"

programmers must implement themselves in the application. Object-oriented design

patterns typically show relationships and interactions between classes or objects,

without specifying the final application classes or objects that are involved. Many

patterns imply object-orientation or more generally mutable state, and so may not be

as applicable in functional programming languages, in which data is immutable or

treated as such. Design patterns reside in the domain of modules and

interconnections.

There are many types of design patterns:

i. Algorithm strategy patterns addressing concerns related to high-level

strategies describing how to exploit application characteristics on a

computing platform.

ii. Computational design patterns addressing concerns related to key

computation identification.

iii. Execution patterns that address concerns related to supporting application

execution, including strategies in executing streams of tasks and building

blocks to support task synchronization.

iv. Implementation strategy patterns addressing concerns related to

implementing source code to support program organization, and the common

data structures specific to parallel programming.

v. Structural design patterns addressing concerns related to high-level

structures of applications being developed.

Design patterns have proven to be both useful and harmful under circumstances

of usage and programmers understanding of both the application and the design

pattern. Only time will tell if a standard set of patterns will be utilized to code

applications in the future.

Page 14: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 2

Page 15: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 4#"

AIMS AND OBJECTIVES This project work has clearly defined goals in terms of what it intends to

achieve at the end of the implementation time frame.

The primary aim of the project fully concentrates on understanding how

Design Patterns work in conjunction with, and atop the Java EE Platform. And, the

primary objective of the paper is to weigh out the advantages and disadvantages of

applying Design Patterns, and prove our hypothesis that using these patterns is more

beneficial rather than harmful.

Another important objective is to measure various aspects of change that a

Design Pattern brings along with it into an application, and how it impacts various

aspects such as overall performance, design flexibility, maintainability, scalability,

portability etc.

Page 16: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 3

Page 17: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 5#"

LITERATURE SURVEY E-commerce has been one of the fastest growing industries in the retail

sector over the past decade. Today, most consumers shop for products online,

causing the speed of this boom to become truly astounding. Research shows that

new e-commerce applications arise every week, thus resulting in hundreds of

thousands of online stores on the web.

Electronic stores and retailers are gaining popularity by the minute. This is

by far the best time one could start selling on the web. Moreover, the number of

methods to make such applications has also increased multifold. A software

developer did not establish the concept of design patterns; rather, it was a professor

of architecture named Christopher Alexander. Christopher Alexander said, "Each

pattern describes a problem which occurs over and over again in our environment,

and then describes the core of the solution to that problem, in such a way that you

can use this solution a million times over, without ever doing it the same way

twice".

The best-known contribution to the popularity of design patterns was the

1995 book Design Patterns: Elements of Reusable Object-Oriented Software. The

authors—Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides—are

also commonly known as the “Gang of Four” or GoF. The book introduced a

comprehensive pattern language, and gave C++ examples for the patterns discussed

The work of Martin Fowler also had a great influence on the early

understanding of software design patterns. His book, Patterns of Enterprise

Application Architecture is written in direct response to the stiff challenges that face

enterprise application developers. The author, noted object-oriented designer Martin

Fowler, noticed that despite changes in technology--from Smalltalk to CORBA to

Java to .NET--the same basic design ideas can be adapted and applied to solve

common problems.

One of the recent books on Design Pattern concepts called Head First Design

Patterns, written by Eric Freeman, Elisabeth Freeman, Kathy Sierra and Bert Bates

explains the topic in a completely different approach. As a result, the book not only

teaches certain principles of design patterns but also touches its readers emotionally.

Page 18: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 6#"

The most important research paper associated with the project is named,

“An Assessment of Design Patterns' Influence on a Java-based E-Commerce

Application”. Maria Mouratidou, Vassilios Lourdas, Alexander Chatzigeorgiou and

Christos K. Georgiadis published the research paper. The paper not only talks about

e-commerce application with design patterns, but also measures the advantages of

using design patterns using software metrics.

Another research work that helped to integrate design patterns into the

application is called “Improving a Web Application Using Design Patterns”. This is

a case study by Phek Lan Thung, Chu Jian Ng. This paper analyses and compares a

number of design patterns focusing on architectural and navigational design patterns

for general features in web applications. Finally, it describes a case study of a

school’s website and propose several design patterns to enhance the usability of the

website.

Creational Structural Behavioral

Factory Method Adapter Interpreter

Abstract Factory Adapter Command

Builder Bridge Mediator

Prototype Decorator Memento

Singleton Facade Strategy

Proxy State

Flyweight Observer

Composite Visitor

Template Method

Chain of Responsibility

Iterator

Table 3.1: GoF Classification of Design Patterns

Page 19: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 4

Page 20: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 7#"

EXISTING SYSTEM Today, there are a hundred types of e commerce applications on the World

Wide Web. But the most influential among them is undoubtedly the B2C (Business

to Consumer) model, where commodities or services are delivered to consumers by

a single business entity. There are many famous websites today that run on this

model, Indian sites like flipkart.com, jabong.com, inkfruit.com and myntra.com.

These websites sell electronics, apparel and books to its customers on the Internet.

Some international website that make big business with this model include

amazon.com, dell.com, bestbuy.com, hersheys.com and apple.com.

Another similar website called YuvaBazaar.com will be used as a base

application for comparison, because it has most of the features of traditional B2C e-

commerce applications. Moreover, this website also has functionalities and

processes similar to final product developed as a part of the project. But the most

important reason for choosing this website is that, it exhibits Object-oriented

features which will help us to efficiently apply software metrics on it. This website

can be described as a typical e-commerce website with minimal design and a

competitive set of technical features. Detailed specifications and working of the

website, yuvabazaar.com will be throughout the chapter, and subsequent chapters

will compare its features and performance with the developed application.

4.1. YuvaBazaar.com – An overview At the first look, the website design may appear to be organized and subtle,

but after the first few seconds of moving around the color scheme and interface

design seems poor and boring. This may also prove an advantage when users who

are new to web surfing, as they may easily find navigation icons and links

throughout the website. The website deals with selling of only mobile phones,

moreover only by four manufacturers.

As we know this website is completely mobile-centric, it also has specific

offers on mobile phone purchases being displayed on the landing page. It also

provides the customer with a host of the industry standard features like 24x7 online

support, online payment gateway and Cash-on-Delivery (COD). All the above

features are helpful for attracting a wide array of customers in order to sell a host of

Page 21: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 8#"

mobile phones on this portal. The home page consists of the main logo with a punch

line that says, “India’s Next Generation Marketplace”. It also has a small number of

important navigation links that take a visitor to important pages like the About Us

and Contact Us page. The next important aspect is the social websites widgets

provided at the side. These widgets help customers and the website by marketing the

products and the user reviews over the social circles of the user. Moreover, 3 famous

social networking sites are used for connecting users to their friends and sharing

their experience. These sites are facebook.com, twitter.com and plus.google.com.

The Facebook social plugin helps every user to see how many Facebook

users like the website page, and how many among them are friends with a particular

user. It is most likely for a person to trust a business when another friend also trusts

it. This highly increases the brand credibility and reach, thus allowing the website to

come up on news feeds of millions of Facebook users. In a similar way the Twitter

and Google Plus plugin help the business to extend its reach to places and customers

where it have been impossible to contact physically. Most importantly, social

plugins and interactions like these help users to believe in the product the website is

selling.

There is a vey helpful tool which helps to convert all the website text into a

number of Indian languages, thus proving that yuvabazaar.com is totally focused

towards catering only Indian customers. The translations allows the website to be

readable in languages like Hindi, Bengali, Gujarati, Tamil, Telugu, and Urdu. It is

also important to note that this change in language is taken care by the Google

Translate tool and does not need to refresh the entire page. Thus increasing user

satisfaction and ease-of-use.

The website shows poor performance at a functional level, because loading

time for each page is quite long. It indicates that the code for the website may be

very redundant or inefficient. Even with a low load where only few brands of cell

phones, the web site shows slow loading time at broad band speeds, this is a great

drawback. The website is not made with a scalable design in mind, which will

certainly cause great issues when upgrading product catalogs to thousands of

products. The site may also face high load during peak traffic when a large number

Page 22: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 9#"

of users access the site simultaneously. Coding errors like these may also cause the

server to crash at high load or stress conditions.

When a product from the main catalog is selected, it loads a detailed

description of the product. This page talks only about this product in a holistic

manner. All the specifications are complete, with numerous images on the side that

one can browse in real time. This gives a customer a complete overview of the

product and also helps in visualization of the product concerned. Most importantly,

it has a button to add one or multiple orders of the product added into the shopping

cart. The description is divided between 2 types, a quick one and an exhaustive

specification table.

The quick description talks about the features that will stand out and talk

about the best features of the product. For the mobile phones, as in the case of

yuvabazaar.com, the quick description talks about the most talked-about features of

all mobiles. These include the camera, video recording, screen size, memory size,

RAM, processors and operating system. In many cases there may be some common

features like Bluetooth, WiFi and battery etc., which are mentioned along with the

most advanced features. This is done because, even thought these small features are

well known, but they may be upgraded to a newer, unseen version than usual

phones. In these cases phones may Bluetooth version 4.0, whereas usually phones

have Bluetooth version3.0. These days the latest OS versions being launched by the

mobile manufactures has also become very popular, whereas, few years ago, people

did not bother what firmware version came with their mobile handset.

The next section describes the specification details of the phone in a holistic

way. The tabular view makes it easy to match the attribute to its description. This

will help many customers while getting the exact requirements according to their

demands. Another important benefit of this table is that it can be easily used to

compare 2 or more products easily. This is mainly because mobiles share most of

the features with some differences here and there. A user can compare attributes of

different mobile phones and chose the one that suits his/her needs appropriately.

The website has a shopping cart to store the selected items before payment

process. This feature comes handy when customers need to buy multiple products.

Another advantage of a shopping cart is that once a user logs out, the shopping is

Page 23: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 10#"

never deleted. Thus the user can come back and restore the contents of the shopping

cart and continue with payment directly. The website allows new users to register to

their website using a registration form. Users can also login by using their Facebook

ID. The credentials of the user are then given to yuvabazaar.com by facebook.com

after confirming the consent of the user.

Figure 4.1. Class Diagram for www.yuvabazaar.com

"

Page 24: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 5

Page 25: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 11#"

PROBLEM STATEMENT & SCOPE Today, every business aspires to have an impact not only in the local markets

but also on a global scale. This is the reason why more businesses are willing to

develop online stores for marketing their products on the World Wide Web.

Developing e-commerce applications requires both skills and experience. It is

difficult to develop powerful, scalable and robust applications in a few, simple steps.

Such applications should provide users with stability under high loads, handling

concurrent users, uniform performance under high load, fault tolerance and gradual

degradation of services under stress.

The project involves development of an ecommerce application for B2C

model. The application features architectural, implementation and user interface

level design patterns. This project statistically measures the advantages of using

software design patterns for a Java-based e-commerce application. The final product

will comprise of a generic application for an online store that has all the functions

that a user needs today. It will aim to capture the experience of experts so that new

developers can get assistance.

This project statistically measures the advantages of using software design

patterns for a Java-based e-commerce application. The performance of the

application would be measured by industry-standard software metrics.

Characteristics to be observed are coupling, cohesion, complexity, reusability,

maintainability and flexibility. These properties are transformed into low level

metrics like Coupling Between Objects (CBO), Lack of Cohesion in Methods

(LCOM), Changing Methods, Changing Classes and quick response time and many

more.

Page 26: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 6

Page 27: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 12#"

PROPOSED SYSTEM The project is aimed at assessing the influence of object oriented design

patterns on a Java based e-commerce application. The application that is proposed

will be a pure Java, cross platform and scalable e-commerce application that will be

designed to cater demands of large traffic and high transaction frequencies. The

application under development will resemble a traditional e-commerce application

only from the front-end. But at the back-end, it designed from the ground-up into

advanced, well-designed software that follows both Software Design Principles and

Design Patterns. These features not only develop a robust, efficient and scalable

product, they also help to increase coupling and decrease cohesion between the

various software components.

The proposed systems will contain the best features found in the available

B2C e-commerce applications, along with the above-mentioned Design Principles.

Moreover, these features will be integrated into the application using certain design

patterns that were tailored particularly for e-commerce applications. Moreover, the

product will also consist of certain User Interface Level design patterns that also

help the users and provide an enhanced experience of shopping online. The

advantages of implementing software design patterns will be measured by standard

software metrics in order to prove the hypothesis about the design patterns. The

design patterns are supposed to show better results than an application without them.

The most important design pattern affecting the application is the MVC

(Model View Controller) Pattern. It clearly marks the boundaries of three aspects of

the application that work independently to achieve the goal. The “View” is

represented by the interface that is displayed on the browser window. This is the

only aspect of the application visible to the user, whereas, the other aspects on the

back-end are invisible. The “Model” is represented by the database that holds the

complete data for the functioning of the application. This interacts with a

“Controller”, which are actually the different buttons and options on the screen,

which change the user’s view according to the model.

On a visual level, the design and layout of the system would be very user

friendly and easy to access. The navigation buttons provide direct access to

important sections of the website. This will ensure that a user can always access

Page 28: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 13#"

pages that are required, rather than following multiple links to reach the same

destination. For example, the navigation will contain buttons to take user directly to

“Support” page, where there would be detailed information about how to contact the

website owners for any suggestions, complaints or feedback. Thus important pages

will be easy to access and the user will never feel lost.

Another important feature in this system will be the “Wish List”. It is a

special list more like a shopping cart, but with a small difference. A shopping cart

holds item that a customer wants to buy at that time. Whereas, on the contrary, a

user can save certain products into the Wish List and retrieve it for future purchases.

The Wish List has many more uses; one of them is also sharing of a user’s Wish List

publically. This is helpful when a customer wants to share a list of products on the

site that he or she wants to buy in future. It could also be used to store products that

are difficult to find at one attempt within the store. A Wish List is personal list

which every user owns, and has the option to share with publically too. Any product

that can be purchased can also be added to this Wish List. Thus the product

description page will also show a button that helps a user to directly add that product

into the Wish List.

The website will offer a user with multiple options of viewing a product and

its details. At the initial level, all products will be listed on a tabular layout in a

catalog pattern. This table will show a small image of the product, and will also

contain its name, brand and the cost for the same. It may be possible, in some cases,

a product may have certain discounts which also be displayed in this table. Each

product will have a “Quick View” button in its cell, which will open a pop-up

window and slightly dim the rest of the window. The main purpose of this window

is to allow a user to focus directly on a chosen product without any distractions on

the web page. This “Quick View” will show larger images of the same product,

along with some more description about the product, thus highlighting the product

efficiently. The third view is the “Detailed View”, where the whole window will

feature the product, along with its images, description and complete specifications.

It will also have certain levels of extra information that some customers may

require, like availability, time to arrival etc.

Page 29: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 14#"

The website also features two important aspects required for e commerce

applications, these are Cross Selling and Up Selling. These features help the store to

sell more products and also expose the customer to a larger product range. These

design patterns will be visible on the product details page; these will give

customized recommendations to users while viewing at a particular product. Thus,

Up Selling will help a user to find products matching his or her requirement. For

example, if a user looks at the details of a portable hard disk of company A, he will

see a small window having 3-4 more portable hard disks of the same manufacturer

with similar configurations or same configuration with different manufacturers. The

user instantly knows how other products are priced and can make a purchase

decision even faster. The other feature, Cross Selling helps a user add auxiliary

items that are related to the product. For example, when a user looks at a mobile

phone, another panel will show certain products like headphones, covers and other

compatible accessories. Thus, a user can select a package of these recommended

products at a discounted price.

In some cases, users do not browse for products in a large list. They may

know the exact name for it and would want to search for it directly. In order to make

this possible, the site will have a search box that will display suggestions as the

keywords are typed. Thus the user can identify the product and access its details

even faster. The search box requires all products to contain keywords or metadata.

When the user matches these keywords or metadata tags with the search query, the

application will retrieve the names of the product and add them to a small drop

down list. Thus, the database will be designed in a way that allows the e commerce

application to not only hold thousands of products, but also search one product

between thousands.

Page 30: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 7

Page 31: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 15#"

METHODOLOGY The Java Enterprise Edition (Java EE) platform provides the ground for the

development, deployment and execution of complex and large-scale E-Commerce

applications in a distributed environment. It is based on well-defined components to

provide server-side and client-side support for developing multi-tier E-commerce

applications. It is considered to be a three-tier architecture, because of their

distribution in three layers: a client tier, a middle tier (Web and Business

Components) and a back-end tier.

But nowadays as the modern E-commerce applications are becoming very

complex, the need for lower maintenance costs is becoming more and more obvious.

This can be achieved by developing an application, which is easy to extend and to

further develop. The Java EE criterion provides well technical support for the

construction of E-Commerce systems with extensibility and flexibility. But the

unclear tier partition or the mix of presentation and logic in Java EE model is

disadvantageous for the maintenance and extension of E-Commerce systems for the

future. The design patterns are one approach for solving this problem.

The application of design patterns positively influences design properties

such as low coupling, high cohesion, maintainability, extensibility, reusability and

flexibility. The improvement in these design properties thereby improves the

functionality of the application and makes it more efficient. But along with the

efficiency, a good and friendly user-interface also plays a vital role in the success of

an e-commerce application. A good user interface can be built by applying some

user-interface design patterns such as Easy-undo, Cross-selling and Up-selling,

opportunistic linking, etc. Clever applications of these interface design patterns can

give the company more control over the user behavior on their website and,

simultaneously, make programs easier and more intuitive for the site’s visitors.

In order to achieve Design Principles, we will implement two specific object-

oriented design patterns and two graphical user-interface design patterns, which are

as follows:

Model-View-Controller

Front Controller

Page 32: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 16#"

Easy undo

Cross-selling and Up-selling

But, after implementation of the four design patterns described above, there is

a need to show the impact of these design patterns on our application. Design

patterns are not always beneficial. In some cases, ignoring the forces of the pattern

can lead to its improper use regardless of design philosophy. For example, if the

algorithms require input data that is widely different for each algorithm, it may take

a lot of work and effort to resolve them all to a common interface. Handling varying

returned data could be just as problematic. Due to this uncertainty, their effect on the

application has to be studied.

So, the first task is to evaluate the improvement of design properties after the

implementation of each design pattern using software metrics. Another task is to

assess the influence of design patterns on the maintainability of the e-commerce

application under study by examining the evolution of software metrics when

performing certain extensions.

7.1. Design Patterns The specifications and implementation of the design patterns used by the application

can be described as follows:

7.1.1. Model View Controller (MVC) Pattern Properties

Type: Behavioral

Level: Component / Architecture

Description

Model–View–Controller (MVC) is an object-oriented system design pattern

that separates the representation of information from the user's interaction with it.

Under this approach, an application is divided into three core components: the

model, the view, and the controller. Each of these components handles a discrete set

of tasks.

Page 33: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 17#"

View- The view is the interfaces and classes the user sees and interacts with. For

Web applications, this is usually an HTML or PHP interface.

Model- The model represents enterprise data and business rules. Model includes

databases and component objects like EJB and ColdFusion Components.

Controller- The controller manages changes to the model. It interprets requests from

the user and sends commands to its associated view to change the view's

presentation of the model (e.g., by scrolling through a document).

Figure 7.1. Structure of MVC pattern

Example

In an online store, if a customer wish to see his/her contact details, it will

pass a request to the controller in the form of method (displayCustomerContact()).

The controller then extracts the required information from the Model and displays it

on the client’s browser.

Page 34: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 18#"

Figure 7.2. MVC pattern example

7.1.2. Front Controller Pattern Properties

Type: Structural pattern

Description

The front controller manages the handling of the request, including invoking

security services such as authentication and authorization, delegating business

processing, managing the choice of an appropriate view, handling errors, and

managing the selection of content creation strategies. It has following components:

Controller- The controller is the initial contact point for handling all requests in the

system. The controller may delegate to a helper to complete authentication and

authorization of a user or to initiate contact retrieval.

Dispatcher- A dispatcher is responsible for view management and navigation,

managing the choice of the next view to present to the user, and providing the

mechanism for vectoring control to this resource.

Helper- A helper is responsible for helping a view or controller complete its

processing. Thus, helpers have numerous responsibilities, including gathering data

required by the view and storing this intermediate model.

Page 35: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 19#"

View- A view represents and displays information to the client. The view retrieves

information from a model.

Implementation

1. When the web application receives incoming requests, the system routes them to a

Front Controller servlet.

2. The Front Controller retrieves the appropriate data using a Helper bean.

3. It then determines the appropriate view type based on the client within the View

Mapper.

4. Based on input from the View Mapper, the Dispatcher returns the view

information to the Front Controller.

7.1.3. Easy Undo Pattern Properties

Type: User Interface

Purpose

Provide safe undoing capabilities in a complex process

Description

The user can be provided with Undo facilities avoiding him to use navigation

facilities for the purpose of editing some information. This pattern extends the idea

of backtracking typical in Web applications adapting it to the application’s

semantics. Instead of returning to the last Web page (using the Back button), we

return to the corresponding state to undo the operation. It uses a backtrack-forward

algorithm that changes the usual browsing semantics adapting it to the needs of the

store.

Implementation

This strategy has many variants due to the inherent conversational nature of

interaction in e- commerce. The record of a particular customer activity is a key

component to implement the solution. Such “state” can be either Centralized or

Page 36: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 20#"

Client-Side according to the developer’s decision on the particular location of the

information. Once the information about the user activity is recovered, the actual

implementation is reduced to the simple problem of establishing the right transition

to the particular instant.

Examples

In www.amazon.com customer information is added incrementally and he

can choose to change previously entered data. The small buttons near each

information item enables us to correct the information.

Figure 7.3. Screenshot of www.amazon.com

7.1.4. Cross Selling & Up Selling Pattern Properties

Type: User Interface

Description

Cross-selling is a strategy of selling other products to a customer who has already

purchased (or signaled their intention to purchase) a product from the vendor.

Page 37: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 21#"

Up-selling is a strategy which makes the customer purchase more expensive items,

upgrades and other add-ons in an attempt to make more profitable sale.

Implementation

Retailers arrange products to enhance Cross-selling and Up-selling by

placing complementary items in close proximity.

It uses three different strategies:

• Advantage of available data is taken: It is a predictive model, which

identifies new trends, and customer needs.

• Appropriate resources are deployed: Data analysts or appropriate

technology is used to both analyze the data and link the insight with cross-

sell and up-sell opportunities that fit.

• Consider when and where to reach out: To strategically find about when

and where cross-sell and up-sell offers will be made.

Examples

Up-selling

When user does booking in hotel, and moves to payment gateway, this page appears

with tons of options to makes the customer book add-ons and increase the sales

value.

Figure 7.4. Screenshot of www.carvihotel.com

Page 38: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 22#"

Cross-selling

When user purchases a particular item from the application, the list of related items

appear on the screen and persuade the customer to purchase more items and increase

the purchase order.

Figure 7.5. Screenshot of www.agacistore.com

7.2. Software Metrics Description

The goal of software metric is to measure the essential parameters that affect

software development. Recent results indicate that the conscientious implementation

and application of a software metrics program can help achieve better management

results, both in the short run (for a given project) and in the long run (improving

productivity on future projects).

Measurement Process

We will use the basic process model of input - process - output to discuss

software entities. Software entities of the input type include all of the resources used

for software research, development, and production.

Page 39: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 23#"

Software Metrics to be measured

The quality of the source code has been evaluated using a set of metrics.

Simple classes with few methods are easy to change and extend. The metrics that are

used to evaluate how easily the source code can be maintained and extended before

and after the implementation of each design pattern are:

• Coupling Between Objects (CBO): It measures the number of other classes to

which a class is coupled to. Since objects of the same class have the same properties,

two classes are coupled when methods declared in one class use methods or instance

variables defined by the other class. Changing Methods (CM), it measures the

number of distinct methods in the system that would be potentially affected by

changes operated in the measured class.

• Changing Classes (ChC), it measures the number of client-classes where the

changes must be potentially operated in result of a change in the server-class.

• Lack of Cohesion in Methods (LCOM)

Measures - How widely member variables are used for sharing data between

member functions.

Calculation - Count of the pairs of class methods that don't access any of the

same class variables reduced by the number of pairs that do. In Imagix 4D,

an option controls whether inherited member variables are considered to be

in the set of class variables.

Use - A higher LCOM indicates lower cohesion. This correlates with weaker

encapsulation, and is an indicator that the class is a candidate for

disaggregation into subclasses.

7.3. Hypertext Modeling Hypertext model aims at defining the hypertext topology of the web application. We

respectively design hypertext model for nine function modules, and then connect

Page 40: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 24#"

them to compose the whole hypertext model for the web application of the PC

online shopping. In this section we provide the hypertext model of the Shopping

Cart Module to describe the hypertext modeling method.

Figure 7.6 shows the hypertext model of shopping cart module in WebML.

Customers view the PC goods information represented by Product detail DataUnit in

the Product detail Page. After customers choose this goods, the goods will be added

into the cart data table by AddToCart, AddUnit, and then follow the OKLink (green

link) to Cart Content Page which will display the selected goods in cart data table by

Cart details MultiDataUnit. We can clear goods from shopping cart by EmptyCart

DeleteUnit. If the result of empty cart operation is success, the response will follow

the OKLink (green link) to Cart Content Page, otherwise the response will follow

the KOLink (red link) to Cart Content.

Figure 7.6. Hypertext model for a Shopping Cart Module

Page 41: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 8

Page 42: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 25#"

ANALYSIS "

Existing Application (YuvaBazaar.com)

Proposed Application (RayBan)

Poor performance at functional level such as loading time of each page is quite high.

High performance at functional level as it applies various design patterns which

improves its efficiency.

The application doesn’t apply any object-oriented design pattern.

The application applies two object-oriented design patterns, which are MVC

and Front controller.

The design and layout of the application is very basic and monotonous.

The design and layout of the application is user friendly and easy to access.

The application is not entirely robust and scalable.

The application is robust, efficient and scalable to a great extent.

It does not provide the feature of Wish list. So user cannot maintain a list of products

he wish to buy.

The application incudes an important feature called Wish list, which allows the

user maintain the list of products.

It uses Google translation tool, to translate the website into common Indian

languages. It doesn’t provide such feature.

The application does not apply cross-selling and up-selling user-interface design

pattern.

The application applies cross-selling and up-selling feature, which helps the store to

sell more products and also expose the customer to a larger product range.

It does not provide Easy-Undo feature.

It provides Easy-Undo option, which allows the user to safely undo capabilities

in a complex process.

Table 8.1: Difference between the existing and proposed application

Page 43: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 9

Page 44: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 26#"

DETAILS OF HARDWARE AND SOFTWARE

9.1. Software Details Core:

Parent Application Base Framework: Java EE 6

User Interface: Java Server Faces 2.0, with RichFaces 4.0 (by Jboss)

implementation OR Vaadin Framework for UI.

Integrated Development Environment: Eclipse IDE (Juno)

CMS: Custom

Data:

Database: PostgreSQL 9+

Database Management: Navicat for PostgreSQL 9+

Database Persistence: Java Persistence API [JPA] 2.0, along with Hibernate

3.0 implementation.

Implementation:

Version Control [Distributed]: Git

Cloud Web-App Hosting: Jboss EAS [OpenShift Server].

Documentation: LaTeX

9.2. Hardware Details Server Machine:

1 TB

Intel QuadCore Processor

16 GB RAM

Client Machine:

500 GB

2.3 GHz Intel Core i5

4 GB RAM

Page 45: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 10

Page 46: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 27#"

DESIGN DETAILS UML Diagrams explaining the business logic of the application:

Class Diagram: Static Structure Diagram describing the structure of our application, includes the Product, Catalog, User, Shopping Cart, Transaction, Shipment, WishList, Purchase and other related classes.

Figure 10.1. Class Diagram

Page 47: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 28#"

Use Case Diagram: Diagram defining the interactions between the User and the

Administrator (Server Admin) to achieve the basic goal of purchasing/selling a

product.

Figure 10.2. Use Case Diagram

Page 48: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 29#"

Sequence Diagram: Diagram explaining the sequence of events in a properly laid

out timeline.

Figure 10.3. Sequence Diagram

Page 49: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 30#"

Collaboration Diagram: Diagram resembling a flowchart that portrays the roles,

functionality and behavior of individual objects of our system as well as the overall

operation of the system in real-time.

Figure 10.4. Collaboration Diagram

Page 50: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 31#"

Activity Diagram: Diagram representing the workflow of stepwise activities and

actions with support for choice, iteration and concurrencies. It is used to describe the

business and operational step-by-step workflows of components in the system.

Figure 10.5. Activity Diagram showing navigation pattern of the application

"

Page 51: An assessment of Design Patterns' Influence on a Java based e-commerce application

CHAPTER 11

Page 52: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 32#"

IMPLEMENTATION PLAN After going through the design details of our application in the previous

chapter, it is now appropriate to answer all the how’s and when’s?

We shall implement our application in the next consecutive semester i.e. 8th

Semester. After carrying out extensive Literature Surveys and having gained a

deeper understanding of the system to be developed, we are poised to achieve the

project target in a semester’s time frame.

The implementation would be carried out strictly in full compliance with the

project paper. As all the learning and data collection part has been clearly

documented in this report as a part of the first phase of this project, the

implementation plan, or the second phase, would consist of three critical

implementation aspects, viz., coding, testing and deployment.

In the coding section, we shall remain focused on coding the main

application according to the design patterns and the projects requirement, with the

use of technologies specified in the technology stack.

After coding the system, we will be deploying the final application on

rhcloud.com. Once the system is deployed and working, we will be testing the

system and measure the software metrics parameters for our own developed system

and then compare it with the metrics of the existing system, and will comment on

our assumptions and measures.

Testing for the Ecommerce Application will be done on following basis:

As e-customers (whether business or consumer), we are unlikely to have

confidence in a Web site that suffers frequent downtime, hangs in the middle of a

transaction, or has a poor sense of usability. Testing, therefore, has a crucial role in

the overall development process. Given unlimited time and resources, we could test

a system to exhaustion.

11.1. Metrics relevant to e-commerce application The software metrics that are relevant for an e-commerce application are:

I. Browser compatibility

Customers will become frustrated if they cannot get to your e-commerce site easily.

Though relatively simple to do, it pays to spend enough time testing in this area.

Page 53: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 33#"

II. Session management

HTTP is a stateless protocol, and server-side programming tools that use Java or

Active Server Pages make extensive use of session objects to capture state

information. This is, for example, how many pages store items in a shopping cart.

Our experience indicates that any system using session management should be

tested thoroughly.

III. Availability

Unavailability equals lost revenue; it also harms a business’s reputation and can

encourage customers to take their business to competitors. Businesses need to offer

24/7 availability to their customers, with availability levels of 99 percent or higher

being the desired norm.

IV. Transactional Processing Test

• Order processing

Order processing can involve the automated creation or update of transactions, or

the delivery of information to back-end systems.

• Payment processing

Approaches to payment processing vary from the simple capture of credit card

details for offline manual processing to real-time card processing. Irrespective of the

chosen approach, you must test several basic actions, such as determining whether

the system carries out the necessary validation and debits the correct amount from

the credit card. The log must also correctly record each transaction.

V. System integration

Developers must often integrate e-commerce systems with existing back-office or

legacy systems, such as accounting and stock-control systems. Or, you could need to

integrate e-commerce systems with third-party applications, such as e-mail. In some

cases, such as in cross-platform integration, you can employ specialized middleware

technology such as CORBA (the Common Object Request Broker Architecture) or

messaging (implemented in software such as IBM MQ Series) to integrate systems.

Page 54: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 34#"

VI. Login and security

Security (or a lack of it) is a major barrier to e-commerce, particularly in Europe.

With the rise in credit card fraud and high-profile hacker attacks, customers

increasingly avoid e-commerce sites and systems they perceive as insecure.

VII. Insecure information transmission

Transfer of information occurs from browser to server, server to browser, server to

back-end system and vice versa. For some, Secure Sockets Layer (SSL) has become

the de facto standard for secure online communications. Where information is

sensitive, you must test against stipulated security requirements. What level of

encryption is required, and does the encryption system meet these requirements?

"

11.2. Gantt charts

"Table 11.1. Gantt Chart Table

Page 55: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 35#"

"

Figure 11.1. Gantt chart 1

""

Figure 11.2. Gantt chart 2

"""

Page 56: An assessment of Design Patterns' Influence on a Java based e-commerce application

AN#ASSESSMENT#OF#DESIGN#PATTERNS’#INFLUENCE#ON#A#JAVA#BASED#E6COMMERCE#APPLICATION#

DEPARTMENT#OF#INFORMATION#TECHNOLOGY! 36#"

References Websites

http://msdn.microsoft.com/en-us/library/ff648617.aspx http://www.designofsites.com/advanced-e-commerce/cross-selling-and-up-

selling http://ist.berkeley.edu/as-ag/pub/pdf/mvc-seminar.pdf http://msdn.microsoft.com/en-us/library/ff649643.aspx http://wps.prenhall.com/wps/media/objects/5073/5195381/pdf/Online_Chapt

er_19.pdf http://www.cs.iusb.edu/thesis/SKhodali_thesis.pdf http://guides.library.ucsc.edu/write-a-literature-review

Books

Object Oriented Design Knowledge by Javier Garza & Mario Piatini Design Patterns: Elements of Reusable Object-Oriented Software by Gang of

Four (Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides) Head First Design Patterns by Eric Freeman & Elisabeth Freeman Applied Java Patterns by Stephen Stelting & Olav Maassen

Journals

Use Case Based Innovative Design of E-commerce Website by Rongrong Gong, Shijian Luo, Ji He

Relationship between design patterns defects and crosscutting concern scattering degree: an empirical study by L. Aversano, L. Cerulo & M. Di Penta

Improving a Web Application Using Design Patterns: A Case Study by Phek Lan Thung, Chu Jian Ng, Swee Jing Thung & Shahida Sulaiman

An Assessment of Design Patterns' Influence on a Java-based E-Commerce Application by Maria Mouratidou, Vassilios Lourdas, Alexander Chatzigeorgiou & Christos K. Georgiadis

Can Patterns Be Harmful? by Alan Shalloway Building E-Commerce Applications from Object-Oriented Conceptual

Models by Oscar Pastor, Silvia Abrahão & Joan Fons

"