Design and Implementation of Online Shopping System Based on B/S Model

. Abstract . B/S structure (Browser/Server) is one hidden client mode after WEB development. This kind of network structure mode unifies WEB browser as the client-side in order to integrate the core part of system function realization to the server. B/S model simplifies system development, maintenance, and usage. The client only needs one Browser under the B/S model, and the browser interact data with database through Web Server. Since the B/S model has such huge advantages, this online shopping system is based on this model. The system through the MVC(Model, View, and Controller) framework integrate network of online shopping system, completing the control layer management, processing data access. Finally, the system can meet online shopping requirements basically, and its also a good application of e-commerce. Customers can know the relevant information of products at any time, and they can have mass commodity information. Besides, the drawbacks of traditional shopping such as geographical and time limitations have been solved completely.


Introduction
Internet technology is the newest and exciting technology in the world. With highly speed development, it brings many conveniences to the people, also becomes the focus of network application in present. This technology involves not only in the traditional industry, but also in e-commerce, Online Shopping is a remarkable case [1] . The system has realized the function of shopping online, and the condition of shopping will not be restricted by time and region, so it is convenient to understand the information of all commodities. This development model has promoted the economic development greatly. At the same time, the emergence of trading platform such as mobile payment, online payment, these kinds of payment methods are convenient and quick [2] .
In addition to the above discussion on the advantage of online shopping, and the paper also realized the functions of online shopping system, it is divided into several parts: the first part is detailed introduction of system relative technologies and principles. And the system requirement is second part. In this part, it has described the hardware environment and the requirements of system implementation in detail. Once these requirements are clear, the third part is about to implement these functions, both foreground and background functions are included. With regard to database, it also play a particularly role in system design, the part four is detailed database design, containing relationships between entities, attributes of individual tables and relation of them. With an emphasis on software implementation, and several classes are highlighted in this chapter. Last but not least, system testing is crucial procession in development of shopping system, in test part, lots of different types of test cases are scheduled to ensure the correctness of system.

Java and JSP
Java is used in this system as programming language, the reason to choose it is determined by its powerful characteristics. Java is an object-oriented programming language with features such as simplicity, objectoriented, distributed, robustness, security, platform independent and portability, and dynamics [3] [4] . And the technology of system is JSP(Java Server Page), a mainstream development technology which is a web development techniques based on Java Servlets [5] . The reason why java codes are embedded with HTML pages allowed by JSP technique is that Java is an objectoriented and secure development tool for the Internet. Therefore, JSP can be cross-platform operation of web development, and makes the web application simpler and faster [6] .

Spring architecture
The Spring framework provides a full-featured MVC module for building Web applications. With spring's pluggable MVC architecture [7] . It is configurable with multiple view technologies Ex Java Server Pages, Velocity, Tiles, etc. Spring MVC separates the roles of the controller, model object, dispatcher Servlet and the handler object. Clear separation of objects and controllers makes them easier to customize [8]

System requirements
This chapter is mainly divided into system feasibility analysis and system functional demand analysis. The former mainly analyzes the economic and operational feasibility, and the latter elaborates the main requirements of the system. Comparing with Online Shopping System, the traditional commodity sales are based on physical stores, which requires a large amount of manpower and material resources, failing to achieve the desired expectations. But obviously, it is a good choice to develop an online shopping system to organize all aspects of commodity and generate considerable savings. In terms of operations, the system runs in Windows, using MySQL database, which has good performance in operation and management [9] [10] .
With regard to the functional requirements analysis, the design of the system is finished after a significant amount of researches. And the Online Shopping system is supposed to have following functions based on all of above analysis: Firstly, the system is provided with personalized user interface and straightforward to use, the systematic proscenium is equipped with display function of commodity information, so that customers can browse and compare commodity. Classification of goods is followed by, which plays an important role in the convenience of choosing items. The next section is the design of shopping cart, users can add items to it, and change the quantity at pleasure. It is necessary to implement the function of setting up the bulletin board of the commodity and sales ranking of goods, so that customers can get the latest information on shelves and some special offers. Last but not least, the system should be excellent function of background management, which is critical for administrator performs maintenance operations.

SYSTEM FUNCTION
After clear understanding of the feasibility and requirement of the system, We analyzed the system function. As shown in fig2 and fig 3, there are two modules included, demonstrating the website module, and background management module.
As shown in the fig 2, functions are supposed to be realized by foreground of system.
Module of Commodity is consisted of three parts: the part of New Products shows the latest fad products, which is visually appealing and stood out. And products in Special Offers always are more affordable and durable. The sales ranking shows all commodities, which is convenient for users to choose items they prefer.
Two main aspects are included in Users Module, they are Users Registration and Users Login.
Shopping Cart, as the name implies, the function of it is that adding items to it and Manage items which users choose. And users have permission to modify the number of items and empty the cart.
Comments are good for customer communication and it promotes designers to improve the system. Meanwhile, the modules of Adding Comments are convenient for users to communicate.  The system of background is mainly divided to 4 parts, which are Management Of Commodities, Users and Orders, Finance. Each module carries on its own task with specific function. For Example, Management Of Orders plays an important role in the overall situation, knowing the status of order in detail explicitly, and the main function of Management Orders is that dividing status into two types: one is payment already processed and unpaid. The operator proceed next step according to the state of order status. And the background system function graph is shown in fig 3. , 0  In this shopping system, the general principle works following steps: the first step is users' operation on client side. For example, users submit forms in client side, and send requests to server and wait server's response. The next step is operation in server side, the server accept and process request, such as process the data requested by shopping cart, calculate the data. The last step is sending necessary information according feedback, and display results to users. The whole process of user request to the server is shown in

Database design
At present, Current mainstream databases include Oracle, MYSQL, Access, etc. The reason to choose MYSQL due to comparison with other databases, which is more lightweight than Oracle, and more advanced in performance of query speed and support schema than SQL SERVER. With rapid increase of data, users and number of visitor, the system of Online Shopping is confronting higher demand in technology and platform. In order to have better management of data, this system uses MYSQL database system, which is mainly used to storing all kinds of related information of the commodities, the system mainly establishes the table of commodities, orders, users, and messages.

Database conceptual design
According to the relationship between each functional module, an entity contact diagram is designed to meet users' needs as shown in

Database table structure design
the system mainly includes the table of Goods, Orders,User. As shown in following tables:

Implementation of main function modules
The main function modules of the system include commodity purchase, order management and implementation of user login and registration. And the system supports MYSQL and JDBC, which interact with database and perform data manipulation. A series of Servlets classes are written to handle transactions, JavaBean is responsible for organizing data structures, the role of JSP pages is to displaying data, the following are mainly classes in the system:

The implementation of servlets classes
Consumer_Servlet: it is responsible for handling user's daily requests, including page jump, view of commodity details, searching products, etc. Goods_cart_Servlet: the function of this class is that dealing with adding goods to shopping cart, deleting goods, paying out and generating orders, etc.
Login_Servlet: this part is responsible for the transaction processing of the login function, including the login of the administrator and the general user, and the user name and password are checked in this part.
Register_Servlet: handling user registration requests, checking uniqueness of user name automatically.

The implementation of JSP pages
Index_jsp: This page is the home page of the system, with a navigation bar designed to navigate the site.
Cart_View.jsp: Displaying items in the shopping cart. List_Order.jsp: Showing the orders that has been generated and specific details.
Recommend_Specific_jsp:this part is displaying the information of recommended and special products dynamically.

Function test
There are many modules involved in the system that need to be tested, and some of them are selected for illustration in this paper.
• User registration test. In this module, user's name, gender, password and other necessary information are supposed to be input. The table 4 shows view of result: • Order management test. This part is designed to make it easier for administrator to add, query, modify and delete order information, and ensures the accuracy and security of input information. Avoiding errors of order information due to a large number of orders. And orders number query are illustrated in this paper, the specific test results are shown in table 5

System evaluation
Evaluation plays an important role in system, In this online shopping system, we considered efficiency from these aspects: response time optimization, include the optimization of page loading speed and connection time.And another indispensable factor is Maximum capacity, will be assessed specifically in this part. For performance evaluation, it's professional to choose LoadRunner, which is efficient for testing . The table 7 shows specific information. In the early testing phase, system load capacity is not well before optimization, and the number of system current connections is small. There are 2 ways to solve this problem,the first one is: introducing caching mechanism, caching and sharing some data by using Memory Cache. Another is changing html static static of website. As we all know, html pages is the most, pure pages, for application where database queries are frequently used in this system but update content are small, this way is a very efficient choice to improve system concurrency. Just as the fig 6 shows the changes of system concurrency.

Conclusion
The system mainly realizes the management of the front shopping module and the function of the backstage management module via B/S framework and java, JSP technology. The front and back functions of this system are powerful, which making online shopping more efficient, and can meet many business requirements, such as commodity management, online browsing and online purchasing. It has certain application value for establishing small-scale e-commerce websites.