Professional Documents
Culture Documents
Table of contents
Contents
CERTIFICATE........................................................................................................... 2
ACKNOWLEDGEMENT............................................................................................ 3
Table of contents................................................................................................... 4
Introduction........................................................................................................... 6
1.1
Assumptions................................................................................................. 7
Page 1
Page 2
Introduction
Online Shopping Mall System is a form of electronic commerce which provides a customer
to check the availability of the products, details of the products, to add/remove the items in
the cart, customer details (sign up), discounts details, placing/cancelling an order, bill
generation, searching the products based on their brand through Internet using a web browser
that is called business-to-consumer (B2C) online shopping.
Online Shopping Mall System are develop to provided customer the facility of buying
products online without wasting time in visiting shops and comparing products. It provides
customer a large variety of products at a chipper rate. Customers get the product delivered at
their doorstep.
The Client side of the Automated Online Shopping Mall System will service one customer at
a time. A customer will be required to login and enter a password for validation. The
customer will then be able to perform one or more actions as mentioned above. A 16 digits
identification number (PIN) will be entered in regards to pay the bill of any purchase made.
An automated Online Shopping Mall System must be able to provide the following services
to the customer:
a. The availability of the products: The Customer can check the availability of a
product.
b. Details of the products: The Customer can check all the details of a product.
c. Add/remove the items in the cart: The Customer can add or remove product in the
cart if he/she want to buy it.
d. Sign up of customer: Customer can sign up by providing his/her details.
e. Discounts details: Customer can see the discount details in a particular transaction.
f. Placing/cancelling an order: Customer can place an order and can cancel a placed
order.
g. Bill generation: Customer can see a final generated Bill.
h. Searching the products based on their brand: Customer can search the products on
the basis of the brands of the product.
Page 3
1.1Assumptions
Developer made certain assumptions on which he lays basis for the development of the
system and made requirement and analysis keeping these assumptions in context:
1. Firstly Customers has Register in online shopping mall through internet web browser,
then they have login online shopping mall website to purchase products.
2. Customers have searched the availability of product and see the price of product.
3. Customers have selected the product and then add products in cart for order the
products.
4. Customers have got online payment for debit/credit card for using 16 digit verification
codes.
5. IF Customers have enter three times wrong 16 digit payment code then they have not
order the product mean there order have been cancel and give the message u can try
again else payment successfully and product order have been done.
1.2.
System Modelling
The Online Shopping mall system needs to be implemented in java by using the principles
and concept of concurrency programming with the help of Threads, Synchronization and
Monitors with adhering to modelling approach. Then it is converted into an executable Java
application. The following diagram will show how the entire system is designed and
developed.
The process includes gathering and analyzing of requirements. These requirements are
modelled into Finite State processes include FSP and LTS representation with proper
implementation of safety and liveness properties. Eventually system is built in Java with
greater use of concurrency features.
Page 4
Requirements
To cancel tickets
Identify the main action event and interaction
Identify and define the main process
Identify and design properties of interest
Structure the process into an architecture
Model
Java Implementation
Page 5
S.No
Functionality
Description
1.
Customer
Up)
2.
Product
order/Cancellation
3.
Schedule
Information
4.
Availability of product in To check the number of products available while making order.
store.
5.
Payment
6.
Check Status
Customer can check their order status from their profile if there is
any cancellation in the order.
7.
Log Sheet
Detail(Sign Customer who will use the System, they can be user of system.
A console where customer can see the details of the product and
order the products and also provide the feature of cancelling the
product order.
requirements
The software to be designed is a simulated system for the automated booking of products.
The system Main screen consists with option of Login and Registration.
Page 6
Search products.
Order product.
Cancel order
Log Out
On selecting Search products user can view the availability of the product by the date
from the list of product and proceed toward order of products. In Order of product
user will get the full information of the product and can give the names of the product
and then proceed on the Confirm for order the product to confirm order and make
payment by entering 16 digit code to order the product and finally a display page to
show the order of customer which can be printout from the printer.
On selecting Check order Status from Menu user will get a page which shows the
status of the order.
Cancel order option in menu can be selected to cancel the product order and all the
status of the product of the customer will be changed to be cancelled.
And finally Log Out to destroy the session and return back to the Login Page.
Page 7
Register
customer
Login
(admin/custome
Search product
Make payment
Show order
Page 8
Admin page
Log Out
Add products
Login Page
Update products
Description
Customer
Payment
product
Order bill
Log
1.6.2 Events
Entity
Description
Card Number
Customer Number
Book
Enquiry
Transaction
cancelation
1.6.3 Interactions
Number
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
Incase customer is requesting for order cancelation, system will prompt an ask for
order ID number.
13.
14.
15.
A log file of each transaction will be maintained for the Administrative use.
Page 10
Page 11
Chapter 3 - Appropriateness of
coding
techniques
used
to
implement design
The System is developed using JAVA which is an object oriented language. So Developer has
used appropriate technique required to developed a object oriented system and some common
guidelines to code a system which are discussed as follow i.
Use of Object Principles: System is using OOPs design principle. It is modelled using
appropriate Classes which encapsulate required data and method for their operation and it
is also using interface and inheritance wherever required.
1) Use of Encapsulation (Class and Methods) Proper class and method are used to
encapsulate program. For each task a class is created which contains data members
and methods.
2) Use of Inheritance & Interface Appropriate Inheritance and interface is used to
implement the design. Inheritance by extending JFrame class in action package and
interface is used by Runnable interface.
3) Use of Polymorphism System developed uses adequate amount of polymorphism
concept such as method overloading, overriding etc.
ii.
Page 12
Memory Utilization: For utilizing less memory the developer has used List and Maps as
it utilizes the memory as required(Dynamically) instead of array that uses fix amount of
memory whether that is usable or not.
iv.
Loosely coupled design: Coupling is the factor of dependency of one class on another
class. The factor of coupling varies between low and high. Systems having high coupling
are unstable and require more effort to modify. High efforts require more cost. High
coupling also decreases the reusability of a class because the dependant class must be
included. Systems having low/loose coupling are stable and when a change is made in
one class, it will not require change in the implementation of other classes.
v.
vi.
Use of Proper Indentation: It is very important to make the code with proper indentation
so that there will not be any problem to read the code properly. It makes the code more
attractive and readable. Implementation uses proper indentation.
Page 13
vii.
Use of Proper Naming Convention: In object any system it is very important to follow
the proper naming conventions to define the classes, objects and methods. It helps to
dangerous chaotic situation which can lead to logical error. Implementation uses proper
naming convention.
Page 14
Concurrencies in Java are achieved by the use of light weight processes called Threads. In
java it can be created in two ways.
To directly control thread creation and management, simply instantiate Thread each
time the application needs to initiate an asynchronous task.
To abstract thread management from the rest of your application, pass the
application's tasks to an executor
In the System, the developer has created threads using the first method. The following is the
code extract of threadThread
public class CCSDassignment
Runnable{
void StartThread(){
new Thread().start();}
public void run(){
Login.setVisible(true);
}
Explanation
implements This is the main class from where the project
starts and this class instantiate the login, so
to maintain multiple logins, the login is
instantiated with the help of Threads.
The idea behind using threads in
login is to allow multiple users to
login into the system at the same
time.
For using threads in a concurrent program, resources should be shared for efficient
management and use of resources. But sharing the resources among threads which are
running concurrently may create a deadlock situation if we do not provide proper lock and
release mechanism.
To develop concurrent programmers with all considerations of shared resources, java
provides many other features for safety and for avoiding deadlock. This is mainly
Page 15
Explanation
Method Update Quantity is called only when
the users are booking the product.
Synchronized is used so that only one writer
can enter into the system at a time.
Now the developer had to satisfy three criterias which are as follows1. Requires that multiple clients access the server concurrently (i.e. solution should
use concurrent programming)
This condition has achieved by following methodso By allowing multiple users to login, booking & cancel the products at the
same time with the help of threads described in Section 4.1.2. For examplepublic class CCSDassignment implements Runnable{
void callThread(){
new Thread().start();
}
public void run(){
Login.setVisible(true);
}
The above code allows multiple login into the system at a time
2. Has the possibility of more than one client modifying a given resource at one
time (i.e. your solution will need to be able to handle the issue of data
corruption)
This condition has achieved by following methods-
Page 16
Page 17
5.1.2
Assumpt
ion
5.1.3
FSP
5.1.4
Java
Code
username,password
FROM
customer
WHERE
5.1.6
TracesSafety
5.1.7
TracesProgress
Page 19
This module is to buy product from the system. The input required for
this system is product id and quantity
5.2.2
Assumpt
ion
5.2.3
FSP
5.2.4
Java
Code
User should login into the system. Enter prodict id and quantity.
purchageerror shows the error message to the user.
LOCK = (acquire->release->LOCK).
BUYPRODUCT
=
(search_product->SEARCHPRODUCT|cancel>BUYPRODUCT),
SEARCHPRODUCT
=
(enter_quantity->validate->(acquire>MAKEPAYMENT|cancel->BUYPRODUCT)),
MAKEPAYMENT = (enter_detals->validate->(success->order_place>release->BUYPRODUCT|{failure1,failure2,failure3}->MAKEPAYMENT|
failure4->release->BUYPRODUCT)).
||SHARED_BUY = (BUYPRODUCT||LOCK).
Input From User
String productid = txt_proditId.getText(); //input product Id from user
int quantity = Integer.parseInt(txt_quntity.getText());
from user
//input quantity
5.2.6
TracesSafety
5.2.7
TracesProgress
5.2.8
Traces
Page 21
This module is to search product from the system. The input required
for this system is product id.
5.3.2
Assumpt
ion
5.3.3
FSP
5.3.4
Java
Code
Page 22
5.3.7
TracesProgress
5.3.8
Traces
5.4.2
Assumpt
ion
5.4.3
5.4.4
Java
Code
Validate=(success->acquire->quantity_update->order_canceled>release-> CANCELORDER|failure->CANCELORDER).
||SHARED_Cancel = (CANCELORDER||LOCK).
Input From User
String orderId = txt_orderId.getText(); //input product Id from user
String userid = session.getuserId();// getuserid from session
Checking if order exists
SQL = SELECT * FROM purchase WHERE order='+ orderId +' and
userid=+ userid + and status=placed;
//check in the database if given username & password exists
If record matches found
If(record)
//Cancel Order Code
If Order ID doesnt matches
JOptionPane.showMessageDialog(null, "Sorry No such order found
Found...!!!", "ERROR", JOptionPane.ERROR_MESSAGE);
5.4.5
LTSA
5.4.6
TracesSafety
Page 24
5.4.8
Traces
5.4.2
Assumpt
ion
5.4.3
FSP
5.5.6
Traces
Page 26
Page 27
Chapter
Testing
Evaluation
and
Testing allows the development team to make sure that they have built the right product by
following a right process. This fact is true for any software model we build. The purpose of
the Model Based Design in concurrent programming is to test and find our errors for all
possible traces. The java application again was tested for the same functionalities as of FSP
model. Although the testing method is different, the goal of the testing is same.
Page 28
1.
Customers
selected the
option for the
first
time
registration
using
the
Register
button
available on
the
Index
page
Registration
Identical to P
page will be the expected
available to result.
the user along
with
the
required field
to fill up the
user details.
No Error
N.A
Test Cases-2
Project Name
Test ID
Testing module
Name of tester
Description of
Module
Pre Condition
No.
Actual Input
1.
2.
Customer will
enter his/her
desired login
name in the
User
name
field.
Expected
Result
After inserting
the
desired
user name and
upon clicking
on the check
availability
button
the
user
name
availability
should
be
checked and
the message
should
available
to
the user
User
will The entered
enter his/her text should be
contact
in
numeric
number
format
and
will be exactly
composed of
10 digit, if not
then
the
message
should
be
popped to the
user.
Error
Correction
Measure
Identical
to Pass
the expected
result
No Error
N.A
Identical
to Pass
the expected
result
No Error
N.A
3.
4.
User
will Entered text
enter his/her should be a
email id
valid email id
in the email id
format after
changing the
text
system
should pop a
message
whether valid
or not
Finally user On clicking
registration
Register
button all the
validation
check should
be done if the
information
provided by
the user will
be valid then
the
registration
should
be
done and the
feedback
should
be
available
to
the user.
Identical
to Pass
the expected
result.
No Error
N.A
Identical
to Pass
the expected
result
No error
N.A
Test Cases-3
Project Name
Online Shopping Mall System
Test ID
AOSMS -03
Testing module Product online order
Name of tester Developer
Description of The module basically deals with the products availability.
Module
Pre Condition
The AOSMS must be Running
No.
Actual Input Expected
Actual
Status
Error
Correction
Result
Result
(Pass/fail)
Measure
1.
The customer The selecting The
Pass
No Error N.A
selecting the item through available
item.
user is done. product
is
2.
Customer has
submitted the
selected item
to
order
successfully.
selected.
If product is Identical to Pass
available to the expected
the customer result
Then order
products.
No Error N.A
Test Cases-4
Project Name
Online Shopping Mall System
Test ID
AOSMS -04
Testing module Online product order.
Name of tester
Developer
Description of This module basically deals with product order of the customer.
Module
Pre Condition
The AOSMS must be Running
No.
Actual Input Expected
Actual
Status
Error
Correction
Result
Result
(Pass/fail)
Measure
1.
The customer A customer Identical to Pass
No Error N.A
has selected has enter her expected
the option of name
for result.
book product order
the
order for the product.
specific item.
2.
The customer The payment Identical to Pass
No Error N.A
has selected form should the expected
the option of be accessible result
payment
to the user
with proper
validation and
critical check
3.
4.
The
card
number for
payment
is
given by the
customer
A
highly
validation
check should
be done and
the
card
number
should be of
exactly
16
digit, numeric
and valid.
Complete
The product
details
has should
be
been given by booked and a
the customer
product
ID
and
order
number
should
be
generated for
the
future
reference .
Identical to Pass
the expected
result.
No Error
N.A
Identical to Pass
the expected
result.
No Error
N.A
Test Cases-5
Project Name
Online Shopping Mall System
Test ID
AOSMS -05
Testing module Cancel order
Name of tester
Developer
Description of This module basically deals with order cancelation of the customer.
Module
Pre Condition
The AOSMS must be Running
No.
Actual Input Expected
Actual
Status
Error
Correction
Result
Result
(Pass/fail)
Measure
1.
The customer A form for the Identical to Pass
No Error N.A
has selected cancelation of expected
the option of product along result.
order
with a field
cancelation
asking
for
order
have
been cancel or
not if yes then
order
have
been
canceled.
something experience while using the simulator. System is free from deadlock and terminal
progress.
This subject Computing and Concurrent System Design is proved to be critical in the real
world application. It can be applied into many information systems. For example, the Stock
Trading System which require appropriate mechanism to update and carry out different
market related transaction and updating s at the same time to solve the deadlock because
database application system can be used in multi user environment where users can read and
update the value at the same time. Without the mechanism from concurrency design, the
application will lead to update anomalies and inconsistency throughout the whole Trading
System.
Concurrent programming encompasses the programming languages and algorithms used to
implement concurrent systems. Concurrent programming is usually considered to be more
general than parallel programming because it can involve arbitrary and dynamic patterns of
communication and interaction, whereas parallel systems generally have a predefined and
well-structured communications pattern. The base goals of concurrent programming include
correctness, performance and robustness.
The developer has learnt various aspect of concurrent programming. The key aspect of this
module is Model Based Design Concept. As part of modelling developer has learnt to prepare
FSP, generate LTS diagram using tool LTSA. Apart from testing the LTSA through traces is
very useful to find the error and deadlocks. Developer also acquired the skills to implement
concurrent systems in Java in a systematic way, requirement -> Model -> Implementation.
Extensive use of threads, monitors and other features helped the developer to learn
concurrent programming in practice.
To be more specific, developer has obtained knowledge in the areas of concurrency,
deadlock, deadlock avoidance, parallel composition of asynchronous processes, interleaving,
structure diagrams, monitors and Conditional Synchronization, Safety & Aliveness
properties.
Chapter 10
References
BOOKS
Fowler, M. and Scott, K., UML Distilled Applying the Standard Object Modelling
Language, 1997, Addison-Wesley.
- Magee, J. And Kramer, J., 2008, Concurrency: State Models & Java Programs, 2nd Edition,
Wiley, J. and Sons.
- D.J.Hatley, I.A. Pirbhai, Strategies for Real-Time System Specification, 1988, Dorset House
N.Y.
-Balagurusamy E, (ed) 2007, Programming with Java A premier, 3rd Edition, TATA McGrawHill, New Delhi.
Bashman B, Sierra K, Bates B, (ed) 2009, Head First Java, 2nd Edition, SPD OReilly, USA.
Herbert Schildt (2002), The Complete Reference Java 2, 5 th Edition, TATA McGraw-Hill,
New Delhi.
WEBSITES
1. http://www.math-cs.gordon.edu/courses/cs211/ATMExample/ClassDiagram.html
Accessed on: 5th May 2013.
2. Lars Vogel. (2011). Java Concurrency / Multithreading - Tutorial. Available:
http://www.vogella.de/articles/JavaConcurrency/article.html. Last accessed 22 April
2013.
3. Corky
Cartwright.
(2007).
What
is
Concurrent
Programming?.
Available:http://www.cs.rice.edu/~cork/book/node96.html. Last accessed 1st May
2013.
4. Bill
Venners.
(2009).
Thread
Synchronization.
Available:
http://www.artima.com/insidejvm/ed2/threadsynch.html. Last accessed 3rd may
2013.
5. Asim Smailagic, Dan Siewiorek. (2000). User-Centered Interdisciplinary Concurrent
System Design., pg-1