Design and implementation of online ordering system

Abstract
The 21st century is a digitalized, networked and informationized society with the network as the core. Netizens in China have fully appreciated the fun brought about by "traveling freely between the world and the Internet without limits". With the rapid development of the Internet, the application of the network is becoming more and more extensive. Such as e-commerce, e-government, online medical care, online entertainment, online games, online teaching, etc.
The topic of this graduation project is the online ordering system.
Based on the content of the graduation project, this thesis systematically expounds the function and realization of the entire network ordering system. From dish management, dish classification and query, to the realization of ordering food carts, user order processing, and system management. Basically, the functional process of online shopping is realized, and users and merchants can order meals online. The interface of this system is simple and intuitive, easy to operate and use, highly interactive, and completely based on the Internet network.
After analysis, we use SUN's JSP development tool and various object-oriented development tools provided by it, especially the data window, which is an intelligent object that can manipulate the database conveniently and concisely, firstly establish the system application prototype in a short time , and then, iterate the requirements of the initial prototype system, continuously revise and improve it, until a satisfactory feasible system is formed.

Contents
Chapter 1 Development Background -------------------------------------------- -----------------------------------------------1
1.1 Purpose and Significance- -------------------------------------------------- ---------------------------------------------1
1.2 Development and Design Ideas--- -------------------------------------------------- -------------------------------------1
1.3 Development goals--------- -------------------------------------------------- --------------------------------------1
Chapter 2 Introduction to Development Tools and Environment---- -------------------------------------------------- -------------=------2
2.1 Introduction to Java Server Page------------------------ -------------------------------------------------- -------2
2.2 Introduction to SQL--------------------------------------- -------------------------------------------------- ----2
2.3 Introduction to JDBC Driver ------------------------------------------------ -------------------------------------4
2.4 Introduction to JavaBeans--------- -------------------------------------------------- ----------------------------5
2.5 Introduction to JAVA ------------------ -------------------------------------------------- ----------------------5
2.6 E-commerce Introduction------------------ -------------------------------------------------- -----------------8
Chapter 3 Function Analysis of Network Convenience Service Management System------------------- ----------------------------------------9
3.1 System function analysis--- -------------------------------------------------- -------------------------------9
3.2 Feasibility study--------- -------------------------------------------------- -------------------------------10
3.3 Demand analysis --------------------------------------------- ----------------------------------------------12
3.4 System Overall Structure Diagram ---------------------------------------------- ----------------------------------13
3.5 Data dictionary -------- -------------------------------------------------- -----------------------------------17
3.6 Requirements Analysis Review--------- -------------------------------------------------- --------------------------18
Chapter 4 Overall Design of Network Convenience Service Management System---------- -------------------------------------------------- 18
4.1. System function design goals ----------------------------------------- ---------------------------------------------18
4.2. Online ordering system Functional module division ----------------------------------------------- ------------------------19
4.3 Architecture of online shopping --------------------------------------------- ----------------------------------------20
Chapter 5 Database Design------- -------------------------------------------------- -------------------------------21
5.1 Database system overview------------ -------------------------------------------------- ----------------------21
5.2 Database table design --------------------- -------------------------------------------------- ----------------21
Chapter 6 Programming---------------------------- -------------------------------------------------- ------------24
6.1 Program description ------------------------------ -------------------------------------------------- -----------24
6.2 Specific module division -------------------------------- -------------------------------------------------- -----25
Chapter 7 Software Installation and Debugging ----------------------------------------- -----------------------------------29
7.1 Software installation and configuration------ -------------------------------------------------- -------------------------29
7.2 Software debugging------------------- -------------------------------------------------- ------------------------30
7.3 Software Testing--------------------- -------------------------------------------------- -----------------------30
Chapter 8 Conclusion---------------------- -------------------------------------------------- ------------------31
Chapter IX Appendix --------------------------- -------------------------------------------------- ----------------32
9.1 Acknowledgments ----------------------------- -------------------------------------------------- --------------------32
9.2 References --------------------------------------------- ---------------------------------------------------32

Chapter 1 Development Background
1.1 Purpose and Significance
The design purpose of this system is to meet the needs of consumers who can order their favorite dishes without leaving home through the Internet, change traditional commercial transactions, conduct transactions on the Internet, and realize online purchase of dishes .
This thesis mainly involves software, database and network technology. Covering a wide range of knowledge, it can effectively improve students' ability to comprehensively use the knowledge they have learned to analyze and solve problems, enhance students' ability to understand and master things, and train students to master scientific research methods, correct design ideas, independent thinking, and enterprising. Exploration and innovation have laid a good foundation for further study and work in the future.
1.2 Development and Design Thoughts
The system uses JSP language to program the online ordering system, the database uses MYSQL to connect to the system, and the background business logic control is performed by writing JavaBeans, that is, JSP + JavaBeans + MYSQL three-layer mode to complete the entire design work. The system is all based on the Internet, and the website is developed with JSP language, focusing on the interaction between users and the website. Therefore, under such a background, according to the current Internet network development trend, the network ordering system has become the preferred architecture of today's application software.
1.3 Development goals
The advantages of online shopping are large selection, cheap price, convenient transaction, saving time and energy, etc. The whole vegetable market is booming. In China, the development of online shopping is necessary and has a basis for development. The conditions for the development of online shopping are becoming more and more mature, but there are still some problems. Only by solving the problems can the vigorous development of online shopping be guaranteed.

Chapter 2 Introduction to Development Tools and Environment
2.1 Introduction to JSP Technology
JSP (Java Server Page) is a new technology that appeared in 1998. A dynamic web page technology standard advocated by Sun and established by many companies is a web development technology based on Java Servlet and the entire Java system. Add script fragments and JSP tags (Tag) to traditional web page HTML files ( .htm, .html) to form a JSP web page (*.jsp). JSP technology provides an easy way to create web pages that display dynamically generated content. As a member of the Java family, JSP inherits the characteristics of Java, that is, the cross-platform feature, that is, compile once and run everywhere.
In foreign countries, JSP has been widely used as a development tool for web applications. In China, although JSP is not a mainstream development technology, many websites are ready to turn to JSP and use JSP to develop dynamic websites due to the strong advantages of JSP.
2.2 JSP working principle
JSP is server-oriented, so it supports any browser. When the Web server and JSP engine encounter a request to access a JSP webpage, the JSP engine sends the request object to the relevant components on the server side, such as JavaBean components, Servlet or EJB, etc., and then the server-side components process these requests, which may need to be retrieved from the database or The information is retrieved from the data store, and then the server-side component returns the response object to the JSP engine. The JSP engine passes the response object to the JSP page, completes the data arrangement according to the HTML format of the JSP page, and finally the Web server and the JSP engine return the formatted JSP page to the client browser in HTML format. This is the browser-Web server-background database three-tier architecture model widely used in current website construction. Because all JSP program operations are executed on the server side, what is sent to the client on the network is only the result obtained.
2.3 JSP architecture
The JSP website development standard provides two technologies using JSP, which can be summarized as mode one and mode two.
Mode 1: JSP+JavaBeans technology In this mode, the JSP page alone responds to the request and returns the processing result to the client. Bean handles all data access, and JSP realizes the performance of the page to realize the separation of content generation and display. When dealing with complex large-scale applications, the page is embedded with a large number of scripts or Java code segments. When the business logic that needs to be processed is complex, this situation will become very bad. A large number of embedded codes make the page program complicated. For For front-end interface designers, this is an incredible thing. Therefore, mode one can be used for small applications, but cannot meet the needs of large applications.
Mode 2: JSP+Servlet+JavaBeans technology Servlet technology is a technology that uses Java technology to realize CGI functions. Servlet technology is very suitable for server-side processing and programming, and Servlet will reside in memory for a long time.
From the perspective of development, Mode 2 has a clearer page performance and a clear division of developer roles. In large-scale project development, Mode 2 is more adopted, and Mode 2 is more in line with the current popular MVC structure (Model/view/ controller), where the Servlet corresponds to the controller, is in the position of the controller, processes HTTP requests, is responsible for generating Beans components or objects used in JSP, and judges which JSP the request should be passed to, etc., JSP corresponds to view, and is responsible for generating the final dynamic web page and return to the browser. The JavaBeans corresponds to the Model, which implements each specific application logic and function.
2.4 Features of JSP
1. Simplified page generation technology.
JSP pages use standard HTML or XML commands to process page formatting and layout design, and use HTML, XML-like tags and script programs written in Java language to generate page content. This makes the page form and page content independent of each other, which is very conducive to the division of labor and cooperation of large-scale projects.
2. Organically integrated with the Java platform.
JSP technology is an important part of the Java 2 platform, and JSP uses the Java language as its scripting language. Almost all Java components and Java APIs can be used in JSP pages, which can give full play to the powerful functions of the Java language. Using JSP technology can create highly scalable and reliable web applications.
3. Hardware platform and server independence.
As a member of the Java family, JSP inherits the characteristics of "Write Once, Rum Anywhere" of Java technology, and can run on most popular operating system platforms and Web servers. The independence of the operating system platform is one of the biggest advantages of JSP over other dynamic web technologies.
4. Functional scalability.
Just as JSP technology can extend functions through ActiveX/COM components, JSP can extend functions through JavaBean, EJB (Enterprise JavaBean) and custom tags.
JSP can connect with large relational databases such as Oracle and MYSQL through JDBC.
JSP provides some hidden objects. These hidden objects can be directly referenced in JSP pages without having to declare them first. Utilizing these hidden objects provided by JSP can make the script function more powerful, and the programming is easier and more convenient. For example, using the request object, you can easily receive information submitted by the user in an HTML form.
2.5 MYSQL database
SQL Server is a relational database management system (DBMS) developed and promoted by Microsoft. It was originally jointly developed by Microsoft, Sybase and Ashton-Tate, and the first OS/2 version was launched in 1988. In recent years, SQL Server has been continuously updated. In 1996, Microsoft launched SQL Server 6.5; in 1998, SQL Server 7.0 met with users; SQL Server 2000 is the latest version launched by Microsoft in 2000. SQL Server features:
1. True client/server architecture.
2. Graphical user interface makes system management and database management more intuitive and simple.
3. Abundant programming interface tools provide users with more options for programming.
4. SQL Server is fully integrated with Windows NT, taking advantage of many features of NT, such as sending and receiving messages, managing login security, and more. SQL Server also integrates well with Microsoft BackOffice products.
5. It scales well across platforms ranging from laptops running Windows 95/98 to large multiprocessors running Windows 2000.
6. The support for Web technology enables users to easily publish data in the database to Web pages.
7. SQL Server provides data warehousing capabilities that are only available in Oracle and other more expensive DBMSs.

2.6 System database connection
JDBC technology is the abbreviation of Java DataBase Connectivity, which is a general application programming interface (Application Programming Interface) provided by SUN that supports basic SQL functions. It consists of a set of classes and interfaces written in the Java language. Through these classes and interfaces, program developers can easily establish links with databases in the Java language, and complete access to different databases by executing corresponding SQL statements. Therefore, developers can use JDBC API without writing an application to access the Sybase database, another application to access the Oracle database, and another application to access MYSQL. Not only that, but applications written in the Java language can run on any platform that supports Java, so it is not necessary to develop different applications on different platforms.
Simply put, JDBC can accomplish the following three things:
1. Establish a connection with the same database;
2. Establish a connection to the database;
3. Process the results returned by the database.
JDBC is a common low-level application programming interface, which provides a unified user interface at the level of different database function modules. To say that JDBC is a low-level API means that it directly calls SQL commands. It is easier to use than some other database connection APIs, but it can also be used as a higher-level, more user-friendly API or development tool. Base.
Many visual Java development tools, such as Visual Age For Java, Visual Café, J++, etc., provide more user-oriented classes and packages based on JDBC, which directly map relational database tables or views to Java classes. Operate directly on Java objects, and the SQL calls that are really needed are automatically generated according to the operations on various properties and methods of objects issued by programmers. Another way to use the JDBC API is that the user program can provide an interface (such as a menu, etc.) to allow the user to choose an operation on the database. After selecting a task, the user is prompted to enter some necessary information, and then a corresponding command is generated according to the user's input. SQL commands and Java programs. In this way, the user can complete the operation on the database, even if he does not understand SQL syntax and JDBC programming.
The three-layer structure of database access is shown in Figure 5.1. To access the database, the browser-side program first passes through the middleware, and then the middleware authenticates the database operation authority. Only through the authentication can the database be operated.

Figure 5.1 The three-tier structure of database access using middleware.
The user's access authorization to the database is completed in the middleware. The query, insertion, update, and deletion operations on the database are all encapsulated in the middleware, which is located on the server side. After the middleware operates the database, the processing result is returned to the browser end user through the Web server. In this way, the user name and password input at the client end can be encrypted by an encryption algorithm and then transmitted on the network, decrypted and authenticated in the middleware, and then the database access operation is performed. The user name and password of the database access authority appear in In the middleware on the server side, it is more secure. This system adopts such a three-tier structure database access mode.
In the three-tier model, commands would be sent to a "middle tier" of services, and the "middle tier" would send SQL statements to the database. The database processes the SQL statements and returns the results to the "middle tier", which then returns them to the user. Its model is shown in Figure 5.2.

Figure 5.2 The three-tier model of JDBC
Because the "middle tier" can control access and cooperate with database updates, and can use an easy-to-use high-level API, this API can be converted by the "middle tier" into low-level calls . So in many cases, the three-layer model can provide better performance, which is the model used in this system.
JDBC is a communication bridge between JAVA applications and databases. It provides three service functions: 1. Establish a connection with the database. Second, pass the SQL statement to the database. 3. Obtain the execution result of the SQL statement from the database. When JDBC wants to establish a connection with the database, first of all, it must first obtain the JDBC driver to connect to the database, and Class.forName() is performing this work. The first step to establish a database connection is to load the JDBC driver class into the JVM (Java VirtualL Machine). In this system, the forName() static function in the java.lang.Class class is used to convert the JDBC The driver is loaded in. After completing the steps of loading the driver, you must use the getConnection() static function provided by the java.sal.DriverManager class to obtain the connection object with the database. The class type of this connection object is java.sal.Connection, SQL instructions must be passed to the database through it, and the execution results also need to be obtained through the connection object. After obtaining the connection object, you must also obtain the Statement object to execute SQL instructions on the database. Statement mainly implements two functions: executing SQL statements and obtaining execution results. In the sql object of java.sql.Statement, after executing the query or modification command function, a ResultSet object is returned. This object provides a pipeline for accessing the SQL execution results, so that the form data can be taken out of the database through it. Each Statement object can only produce one ResultSet object.
The database connection is shown in Figure 5.3:

Figure 5.3 Database connection processing
The specific implementation of database connection processing is as follows:
//Establish JDBC——ODBC bridge
sun.jdbc.odbc.JdbcOdbcDriver;
//Error handling when bridge establishment fails
catch(ClassNotFoundException event){}
//Establish Connect with the database, send SQL query statement, save the result to rs object
Con=establish JDBC——ODBC bridge
Sql=SQL query statement
execute query
Rs=return result
//SQL error handling
catch(SQLException e1){}

With JDBC, it is very easy to send SQL statements to various relational data. In other words, with the JDBC API, there is no need to write a program for accessing the Sybase database, another program for accessing the Oracle database, or another program for accessing the Informix database, etc. Programmers only need to write a program using the JDBC API. A program is enough, which sends SQL calls to the corresponding database. At the same time, the combination of the Java language and JDBC saves programmers from having to write different application programs for different platforms, and it can run on any platform just by writing the program once. Advantage.
The Java Database Connection Architecture is a standard method for Java applications to connect to databases. JDBC is an API for Java programmers, and an interface model for service providers that implement connections to databases. As an API, JDBC provides a standard interface for program development, and provides a standard method for database vendors and third-party middleware vendors to realize connection with the database. JDBC uses existing SQL standards and supports other database connection standards, such as bridging between ODBC. JDBC achieves all of these standards-oriented goals and has a simple, strictly typed, and high-performance implementation of the interface.  
Being robust, secure, easy to use, easy to understand, and automatically downloadable from the web, Java is an excellent language for writing database applications. All that's needed is a way for the Java application to talk to a variety of different databases. JDBC is the mechanism for this purpose.
JDBC extends the functionality of Java. For example, using the Java and JDBC APIs it is possible to publish a web page containing an applet that uses information that may come from a remote database There are various operating systems such as Windows, Macintosh, and UNIX). As more and more programmers start using the Java programming language, the demand for easy access to databases from Java is increasing.
MIS administrators love the combination of Java and JDBC because it makes information dissemination easy and economical. Businesses can continue to use their installed databases and easily access information even if it is stored on a different database management system. The development period for new programs is short. Installation and version control will be greatly simplified. A programmer can write an application or update it once, put it on a server, and then anyone can get the latest version of the application. For commercial sales information services, Java and JDBC can provide external clients with a better way to obtain information updates.
Simply put, JDBC does three things: establish a connection to a database, send SQL statements, and process the results. The following code snippet gives a basic example of the above three steps:
Connection con = DriverManager.getConnection("jdbc:odbc:wombat", "login",
"password");
Statement stmt = con.createStatement();
ResultSet rs = stmt .executeQuery("SELECT a, b, c FROM Table1");
while (rs.next()) { int x = rs.getInt("a"); String s = rs.getString("b"); float f = rs.getFloat("c"); } The above code is a classic summary of JDBC-based database access.




Chapter 3 Functional analysis of the network convenience service management system
In order to finally realize the target system, it is necessary to design all the programs and files (or databases) that make up the system. A module is a collection of programming objects such as data descriptions and executable statements, which are individually named and can be accessed by name. Modularization is to divide the program into several modules, each module completes a sub-function, and these modules are combined to form a whole, which can complete the specified requirements to meet the problem.
3.1 System function analysis
Firstly, analyze the existing system, which is an important source of information. Analyze the function and implementation of the existing system to determine the design goals and models of the new system. Due to limited conditions, the research was mainly conducted online. That is, by registering as a member on an existing ordering website on the Internet to understand its functions.
1. From the user's point of view:
users who become users of the website through online registration can obtain the following functions: dish browsing, purchasing dishes, retrieving passwords, changing passwords, modifying personal information, dish introductions, ordering food trucks, message boards, etc.
2. From the perspective of the website:
(1) The website should include a dish search function: query by dish name (fuzzy).
(2) Order processing function, order confirmation method:
(3) Administrator management:
View user information, and distribute dishes according to user information and user orders.
(4) Menu browsing
3.2 Feasibility study
The main task of the feasibility study stage is to make judgments on whether the new system can be realized and is worth realizing on the basis of the preliminary investigation of the system, so as to avoid spending a lot of manpower and It is found that the system cannot be realized after material resources or the waste caused by the fact that the new system has no practical significance after it is put into use. The analysis of the feasibility of the new system requires the minimum cost to determine whether the system is feasible in the shortest possible time.
①Technical feasibility analysis
The development of the online ordering system is a complex system engineering. In order to ensure the success of system development, engineering system development methods must be adopted, and some development methods that meet engineering standards must be researched. These methods are designed to guide developers in engineering system development, thereby speeding up system development, ensuring quality and reducing development costs. The engineering system development method has indeed achieved certain results in the development practice. This development uses JSP as the development language, Servlet technology, and Tomcat5.0 as the Web server.
②Operational feasibility analysis:
With the popularization and promotion of computer knowledge, more and more people have mastered the basic methods and skills of using computers. With the development of the Internet, users are more familiar with the use of software in the network, WINDOWS and other environments, and they show great interest and enthusiasm for new things.
③Economic feasibility analysis:
The online ordering system brings convenience to people and becomes a new business model. Therefore, the new fashion of shopping at home without going out has arrived, and it is economically feasible to build an online ordering system.
As far as this system is concerned, with the popularity of computers, it provides favorable conditions for students to shop on the Internet. And an online meal ordering system can provide software conditions for students, so that students can buy food without leaving home. Merchants can get profit from it, the best of both worlds.
Through the above analysis, it is completely feasible to develop an online ordering system.
④Operating environment:
The system adopts networked multi-machine and multi-user operation mode. The operating environment of the system includes hardware, operating system, relational database and other software:
Hardware: Central Processing Unit (CPU): Pentium 4 or above processor;
Hard disk: 80 GB Hard disk above;
memory: 512 MB;
display: 17-inch display;
operating system: Windows XP,
relational database: MYSQL;
3.3 Requirements analysis
The task of requirements analysis is to fully understand the working situation of the system through detailed investigation of the objects to be processed in the real world, clarify the various needs of users, and then determine the functions of the new system on this basis. The new system must take full account of possible future expansions and changes.
1. Here we need to understand what specific requirements users have and requirements for system performance.
(1) User needs analysis:
(a) User registration
(b) User login
© menu browsing
(d) Menu ordering
(e) Menu query
(f) Order modification
(g) Password modification
(h) Personal information modification
(i) Administrator
(2) System performance analysis
Requirements for data security and integrity: user information is confidential and only administrators can modify it arbitrarily. Ensure online payment security. The integrity of dish information and user information must be guaranteed. Prevent malicious deletion. The following are the system performance requirements:
(a) High accuracy and reliability
(b) User-friendly, complete functions, and
the © system can be used for easy maintenance and upgrade.
(d) High database access efficiency
3.4 Overall structure diagram of the system:

System ER diagram:

Data Flow Diagram:
   Data Flow Diagram: is a graphical notation that describes the logical model of a software system. This kind of graphic representation can describe the working conditions of the computer software system in essence, and is also suitable for non-computer professionals to learn and master. It is a good communication and expression tool in demand analysis.
   
 Lines with arrows represent data flow, where the arrows indicate the direction of data flow.
 The circle boxes indicate the processing of the data.
 Boxes represent the start and end points of the data. Draw a hierarchical data flow diagram.
Hierarchical Data Flow Diagram:

(a) ER diagram of the network convenience service management system

(b) Check the ER diagram of the network convenience service management system

©User Basic Information Processing ER Diagram

(d) User order processing ER diagram

(f) ER diagram of dish query processing

(h) Administrator E—R Diagram

3.5 Data dictionary:
The function of the dictionary is to define and explain the vocabulary. In structured analysis, the role of the data dictionary is to define and explain each component on the data flow diagram. In other words, the literal set of definitions and explanations of all components on the data flow diagram is the data dictionary. The data dictionary annotates the data flow diagram and various components, and assigns actual content to these components. In addition, the data dictionary also defines and explains other issues that need to be explained in the system analysis. The main contents described in the data dictionary are: data flow, data elements, data storage, processing, and external items. Among them, the data element is the basic component of the data flow, and the data dictionary plays an important role in the system analysis.

Chapter 4 Overall Design of Network Convenience Service Management System
4.1. System Function Design Goals
The theoretical system function design goals are as follows:
(1) Strong practicability: We strive to make the system conform to the habit of the actual operation process, and minimize the user's input, Easy-to-learn and easy-to-use friendly user interface to meet the needs of users at all levels;
(2) Advanced program structure: use contemporary avant-garde software programming, which can prolong its life cycle and be easy to maintain and manage; (3)
Safety and reliability High: The background maintenance function is complete. According to the different usage of the platform at each stage, the administrator can set the corresponding operation authority, increase the system registration, assign the management authority of each column, realize the system maintenance, and ensure the safety and reliability of the system;
( 4) Using the method of modular design: make the system have good scalability to adapt to the development needs of different stages, and facilitate the analysis and maintenance of latecomers; (5) Simple
operation and convenient maintenance: each subsystem has a relatively independent (6)
Powerful query function
: you can query the basic information of dishes, basic information of users, dish evaluation information, user messages, etc. in various ways, and various forms can be formed. At the same time, it can also be summarized, so that managers can grasp the basic situation of users and dishes in a timely and accurate manner.
4.2. Division of functional modules of the online ordering system:
According to the demand analysis and system function design goals, combined with the actual situation, the functional module design of this system is divided into the following modules:

1. Homepage: Here we can see the main functions and information of this system.
2. User registration: Here we can register our basic information, among which phone number and Email are more important, because we need to process these information to facilitate the user's payment and mail order.
3. User login: In order to facilitate the user's payment, mail order and management, we need to become a member before we can consume.
4. Dish browsing: After successfully logging in, the user can browse the dishes in different pages, and submit the desired dishes to the order filling page. If the user enters directly without registration or enters the page without successful login, he will be connected to the "user login page".
5. Order dishes: users who have successfully logged in can order the dishes they need on this page. If the user enters directly without registration or enters the page without successful login, it will be connected to the "user login page".
6. View order: Users who have successfully logged in can modify the ordered dishes on this page. If the user enters directly without registration or enters the page without successful login, it will be connected to the "user login page".
7. Modify order: Users who have successfully logged in can modify or delete dishes that have been ordered on this page. If the user enters directly without registration or enters the page without successful login, it will be connected to the "user login page".
8. Dishes query: Users who have successfully logged in can search for the dishes they need on this page. If the user enters directly without registration or enters the page without successful login, it will be connected to the "user login page".
9. Change password: Users who have successfully logged in can change their own password on this page. If the user enters directly without registration or enters the page without successful login, it will be connected to the "user login page".
10. Modify personal information: Users who have successfully logged in can modify their original registration information on this page. If the user enters directly without registration or enters the page without successful login, it will be connected to the "user login page".
11. Mall Announcement: Publish various dish information or news.
11. Administrator: View user orders, view user information, and distribute dishes according to user information and user orders.
4.3 Architecture of network convenience service:
three-layer structure:

That is: JSP technology + JavaBeans + MYSQL database

Chapter 5 Database Design
5.1 Overview of Database System:
The database system is developed on the basis of the file system and has gone through three stages: hierarchical database, network database and relational database. Since relational databases use two-dimensional tables that are easier for people to understand and accept to organize data, they have developed rapidly and become the mainstream of database products.
The front-end development of this system uses JSP technology, and uses JavaBeans for logic control and database connection, while the back-end database uses MYSQL. The MYSQL database management system is a comprehensive and complete database and analysis product. MYSQL is very easy to learn and use, and there are many introductions and learning materials. MYSQL fully supports Web-enabled database solutions. At the same time, MYSQL also maintains multiple benchmark records in terms of scalability and reliability. These two aspects Features are also the key to the success of enterprise database systems in the fierce market competition. Whether measured in terms of application development speed or transaction processing speed, MYSQL is the fastest database system.
Compared with MYSQL and other large-scale database management systems, MYSQL has reliable security, faster storage speed, high compatibility, and is easy to use. Using MYSQL as the background database provides strong support for system development and supports The operation of the software in the future provides a solid foundation, so we use MYSQL as the background database.
5.2 Design of database tables:
The database of this system includes nine tables, which are dish dishes table book, user registry member, administrator table admin, dish type table booktype, comment table commont, dining car table gouwuche, and news table news, order table num, order details table orderbook. For details, please refer to the database table below:
1. Menu table booK

2. Administrator table admin

3. Dishes type table booktype

4. User registry member

5. Order details table orderbook

Chapter 6 Program Design
6.1 Program Description
Carry out program design according to the previous requirements analysis and overall system design content. This system is developed based on the Java language. The modules I am personally responsible for are mainly developed and implemented using JSP technology + JavaBeans + MYSQL mode. All are designed and implemented in an object-oriented manner.
one. When programming, I used the following definitions, explained as follows:
1. Page is used to define some attributes of the entire JSP page and the values ​​of these attributes.
2. Page import The function of this attribute is to import the classes in the JAVA core package for the JSP page, so that the classes used in the program part, variable and function declaration part, and expression part of the JSP page can be used. Multiple values ​​can be specified for this attribute, and the value of this attribute can be all classes in a certain JAVA package or a specific class.
3. Include file means inserting a file statically.

6.2 Specific module division
1. Main page module

2. User Registration Module
User registration is designed for users who log in to the website for the first time. Before users become users of this site, they must register before they can visit other pages of my site.
① User registration includes: login name, real name, set password, email, etc.
② After successful registration, you can visit other pages of this site.

3. User login module
①User login includes: login name, input password.
② After the user logs in, the administrator checks whether the user's name and password are correct. If they are correct, the user can directly enter other pages of the website to browse and order.

4. Dish Browsing Module
Dish Browsing: After successfully logging in, users can browse the dishes in different pages, and submit the desired dishes to the order filling page.

5. Food cart module

6. Modify password and information module (this module is in charge of me)
Modify password: Users who have successfully logged in can modify their own password and information on this page.

Chapter 7 Software Installation and Debugging
7.1 Software Installation and Configuration
(1) Software Installation: Operating System Windows XP
MYSQL
JDK Installation:
JDK installation is very simple, no difference from installing other software.
JDK configuration:
set JAVA_HOME environment variable: JDK installation directory example: C:\j2sdk1.4;
set CLASSPATH environment variable: JDK installation directory\lib\tools.jar example:
C:\j2sdk1.4\lib\tools.jar; .Set
PATH environment variable: JDK installation directory\bin; example: C:\j2sdk1.4\bin;
Server installation: Tomcat 5.0
Set TOMCAT_HOME environment variable: Tomcat installation directory Example: C:\Tomcat 5.0;
(2) Install Tomcat5 .0 When installing, pay attention to choosing the path of the Java virtual machine, be sure to select the directory of the installed JSDK, and then start the installation.
(3) After the installation is complete, start TOMCAT, and then enter http://localhost:8080 in the browser to see the welcome page of TOMCAT, which means the configuration is successful.
7.2 Software debugging
The purpose of system debugging is to find errors in programs and systems and correct them in time. The debugging methods used in the online ordering system also include these:
(1) Program debugging
Including grammar debugging and logic checking, the test data uses not only normal data, but also some abnormal data to test the correctness of the program.
① Debug with normal data.
②Debug with abnormal data.
③Debugging with wrong data.
7.3 Software testing:
Software testing is a very important link in the system development cycle. Its importance is reflected in that it is the last pass to ensure the quality and reliability of the system, and it is the final review of the entire system development process. If it is discovered and corrected during the testing phase, it may cause unimaginable consequences.
In the online shopping e-commerce platform, we mainly focus on black box testing, supplemented by white box testing. White-box testing is used for key modules.
Test results:
★Chinese garbled characters, the Chinese data retrieved from the database appear garbled characters.
★Parameter transmission error, unable to transmit data.
★When a large number of users access the database at the same time, the efficiency is low, and some users fail to access.
The main solution:
☆I use the following method to solve the garbled problem:
request.getParameter(“choose”).getBytes(“8859_1”),”GB2312”
<%@ page contentType="text/html;charset=GB2312"% >
☆Unified the format of the parameters connected to each module
☆This program is based on small and medium-sized, and uses JDBC data source to connect to the database, which determines the inherent defects of this system. Pure e-commerce websites all use connection pools, and this best solution is abandoned due to technical difficulties and lack of information.

Chapter Eight Conclusion
After ten months of unremitting efforts, the earnest teaching of the instructor, and the solidarity and cooperation of the same group of students, making full use of the professional knowledge learned in the four years of university, and reading a lot of professional references related to design, I Finally completed this graduation project, has basically realized the various functions of the network ordering system.
In this graduation design process, I independently designed and implemented all the functions of five modules including user registration, user login, password change, message board, and dish browsing, as well as the database design of these modules.
Through this graduation project, I have mastered the programming method of a large database such as MYSQL, mastered the JAVA language and JSP technology. Understand the theory of e-commerce and the model of platform development, and master the methods and models of network development. I have a certain understanding of teamwork and software development methods and means, which enriched my software development experience, improved the level of programming, and deepened my understanding of the knowledge and theories learned in many courses and menus. . At the same time, by writing the graduation design thesis, I also basically mastered the writing method and format of the software documentation.
The defects of this system are also obvious, such as security, efficiency issues and so on. Due to time, ability, domestic JAVA, JSP limited technical data and other reasons, some functions are not perfect, in the completed program, there are also many unsatisfactory algorithms, and there is no unified optimization, the system needs to be further improved, and These problems also made me fully realize the difficulties of software development.
Through the graduation project, I learned how to understand a new technology and master a technology. And the basic process of software development. During the learning process, we often ask for help online when we encounter problems, and go to the grocery store to check information, which expands our knowledge.
In short, this graduation project has laid the foundation for my further study and further study in the future. I am very grateful to all the teachers and classmates for their support and help.

Chapter 9 Appendix

9.1 Acknowledgments
During this graduation design process, I received guidance and support from my supervisor. I would like to thank my teacher who knows me very much. The instructor's careful guidance and strong support gave me a lot of help in grasping the overall structure and functions. At the same time, I provided a very superior design environment and gave me patience in programming, database design and other details. His guidance played a key role in my successful completion of this graduation project.
I would also like to thank my alma mater, XXX University, and the teachers and classmates who gave me care and help during the four years of university life. They taught me professional knowledge and the principles of life. Through this graduation project, I also understand that as a computer major graduate, what we need to know is not only to write code, but more importantly, to have the ability to grasp the system design as a whole. I will continue to improve myself in my future work and study, win glory for my favorite alma mater, and open a new chapter of glory for myself.

9.2 References
[1] Sun Weiqin, Li Hongcheng. "Tomcat and Java Web Development Technology Detailed Explanation". Electronics Industry Press, June 2003: 1-205 [2]
Bruce Eckel. "Java Programming Thought". Machinery Industry Press , October 2003: 1-378
[3] FLANAGAN. "Java Technical Manual". China Electric Power Press, June 2002: 1-465
[4] Sun Yilin, Peng Bo. "Java Database Programming Examples". Tsinghua University Publishing House, August 2002: 30-210
[5] Lee Anne Phillips. "Skillful Learning and Using HTML4". Electronic Industry Press, August 2004: 1-319 [
6] Feisi Technology Product R & D Center. "JSP Detailed Explanation of Application Development". Electronic Industry Press, September 2003: 32-300
[7] Geng Xiangyi, Zhang Yueping. "JSP Practical Course". Tsinghua University Press, May 1, 2003: 1-354 [
8] Sun Chung. "Modern Software Engineering". Beijing Hope Electronic Press, August 2003: 1-246
[9] Sa Shixuan, Wang Shan. "Introduction to Database Systems". Higher Education Press, February 2002: 3- 460
[10] Brown et al. "JSP Programming Guide (Second Edition)". Electronic Industry Press, March 2003: 1-268 [11] Qinghong Computer Studio.
"JSP Programming Skills". Mechanical Industry Press, May 2004: 1-410
[12] Zhu Hong, Si Guangya. "JSP Web Programming Guide". Electronic Industry Press, September 2001: 34-307 [13]
Sai Kuichun. "JSP Engineering Application and Project Practice". Machinery Industry Press, August 2002: 23-294

Guess you like

Origin blog.csdn.net/ambiguous__/article/details/130919540