01-11-2016, 02:50 PM
1463041580-FanYang.pdf (Size: 2.31 MB / Downloads: 284)
The purpose of this thesis was to build a food ordering client server application
for Tom Yum Thai Oy, which is a Thai restaurant in Vaasa.
For the customer, this application provides a view of current food information
(category, name, image,price, description etc.) on the website and Android
application. The customer can order food from these two platforms. For the
administrator in restaurant, this application offers a series of operations to add,
update, delete and query the information of food, food order and employees.
The application includes three parts: Background Management Platform, Website
Foreground Public Page and Android Application. The Background Management
Platform was implemented with S2SJ, a combination of Struts 2 framework,
Spring framework and JPA framework. Servlet and JSP were used in the Website
Foreground Public Page. The Android Application is obviously based on Android
framework.
So far, all core functions were developed successfully and the progress of the
project was most rewarding and generated an excellent experience in
programming.
INTRODUCTION
With the rapid development of information technology, web application and
Android application have been increasing in recent years. Compared with the
desktop application, the advantages of web application for users are:
- No need to install and update
- Easily visit through browsers
The advantage of the Android application:
- Mobile application is convenient to carry
- Global partnerships and large install base
- Powerful development framework
- Open marketplace for distributing apps
Based on the advantages of both applications, I motivated myself to develop a
combination project between web and Android application.
Tom Yum Thai Restaurant in Vaasa sells Chinese and Thai food. Due to the
cheaper prices and delicious food, more and more people select to eat in this
restaurant. Meanwhile, with the number of customers increasing, the new problem
occurs. Because the space of the restaurant is limited, the restaurant can only seat
a certain number of customers at the time, therefore, the full customer resource
cannot be utilized.
Mobile Food Ordering Application is the key to solve this problem. Using this
application, the customers need not go to the restaurant by themselves, but they
can order the dishes through computers and Android mobiles anywhere.
The Background Management platform in this application was designed for the
administrator. The Administrator will be able to manage food dishes, dish orders
and company employees here.
7(82)
2 TECHNOLOGY OVERVIEW
The administrator part was developed with struts2 framework, spring framework
and JPA framework, while the display part of website for customers is
implemented with servlet/JSP. MySql was chosen as a database for the project.
The Android part was developed with the Android framework. Following the core
frameworks will be generally introduced in this application.
2.1 Struts 2 Framework
“Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready
Java web applications.” /1/
Struts 2, the next generation product of Struts, is the new framework merged
based on Struts 1 framework technology and WebWork framework technology.
The core of Struts 2 is WebWork. /1/
JPA Framework
“The Java Persistence API, sometimes referred to as JPA, is a Java programming
language application programming interface specification which describes the
management of relational data in application using Java Platform, Standard
edition and Java Platform, Enterprise Edition.” /4/
Persistence in this context covers three areas: /4/
1. the API itself, defines in the javax.persistence package
2. the Java Persistence Query Language (JPQL)
3. object/relational metadata
2.4 Android Framework
Android is known as a mobile operating system based on the Linux Kernel. It is
mainly designed for touchscreen mobile devices such as smartphone and table
computers. Meanwhile, the Android operating system is widely used in televisions,
games consoles, digital cameras and other electronics because of its open and
customizable features. Android was developed initially by Android, Inc. and
bought by Google in 2005. /5/
The source code for Android is available under free and open-source software
licenses. It means that the device manufactures, wireless carriers and enthusiast
developers can freely modify and distribute the software. Most Android devices
ship with a combination of open source and proprietary. /5/
Today, Android has become the most popular mobile OS, and is the leader in
smartphone market in the world. More and more customers select mobile phones
13(82)
with the Android operating system as their first choice. Meanwhile, mounts of
programmers throw themselves into the Android application development camp.
Linux Kernel
At the bottom of the layers is Linux Kernel. It provides a basic system
functionality, such as memory management, device management etc. Also, it
handles the things that Linux is good at such as networking.
Libraries
On top of Linux Kernel is a set of libraries including open-source Web browser
engine WebKit, SQLite database, libraries to play and record audio and video,
SSL libraries and so on.
! Android Runtime
This section provides a key component called Dalvik Virtual Machine that is a
kind of Java Virtual Machine designed for Android. The Android runtime also
offers a set of core libraries: it enables developers to develop Android applications
using the standard Java programming language.
! Application Framework
The Application Framework layer provides many higher-level services to
applications in the form of Java classes. Application developers are allowed to
make use of these services in their applications.
! Applications
All the Android applications will be found at the top layer. The application written
by the developer will be installed on this layer only
APPLICATION DESCRIPTION
There are certain requirements the proposed application must fulfil to meet the
objectives of the project.
The requirements to be achieved:
In Background Management Platform:
! Administrator can add and modify food categories.
! Administrator can add, modify and query food information.
! Administrator can add, modify and query employee information.
! Administrator can manage orders produced from the web application and
Android application.
In the Website Public Page and Android Application:
! Customer can view food information, such as category, name, price, image,
description and so on.
! Customer can order food.
! Customer can modify food item, food amount in Shopping Cart.
! Produce food order.
The requirements that should be achieved:
! The project supports internationalization, customer can select different
language environments according to their real requirements.
The requirements nice to be achieved:
! Permission Management in Background Management Platform
! Query Dish Function in Website Public Page
16(82)
3.1 Functional Description
Destine Food System is divided into two parts in terms of roles, the background
for the administrator, the website foreground public pages and the Android
application for user. Functions corresponding to each role will be introduced in
detail in the following.
3.1.1 Background Management Platform
Figure 5 is a use case diagram to illustrate the main functions in the background
for the administrator.
Log In/Out
Properties:
" Username
" Password
When the administrator connects the background management platform url, a log
in interface will be displayed. The administrator needs to input correct username
and password to log into the main page of the background management page. One
admin username and password is pre-set when the application is initialized.
Add Food Category
Properties:
" Category Name
" Note
When the administrator clicks “Category Manage”, a list view of dish category
will be displayed. On the bottom of the list view page, there are two buttons:
“Add Category” and “Query”. While clicking the “Add Category” button, the
page will be linked to a dish-adding interface, the administrator can add a new
dish category here.
Query Food Category
Properties:
" Category Name
Also, clicking the “Query” Button, a dish category query interface will be
displayed, here the administrator can query current existing dish category
according to the category name.
Modify Food Category
18(82)
Properties:
" Category Name
" Note
In addition, in the category list view page, the administrator can modify the
existing dish category by clicking “Modify” button.
Add Food Info
Properties:
" Product Name
" Product Category
" Market Price
" Sell Price
" Product Code
" Product Style Image
" Product Description
When the administrator wants to add dishes, “Product Manage” just needs to be
clicked; the right frame page will jump to a list view page of dishes. On the page,
the detailed information of existing dishes will be shown, such as Product Code,
Product Name, Category Belong, Sell Price, the state of sale, etc.
Modify Food Info
Properties:
" Product Name
" Product Category
Market Price
" Sell Price
" Product Code
" Product Style Image
" Product Description
The administrator can modify food information by clicking “Modify“ button.
Query Food Info
Properties:
" Product Name
" Product Category
" Sell Price
" Product Code
The administrator can query food information according to different conditions
above.
Sale/Stop to sale
In addition, this project provides “On Sale” and “Stop Sale” functions. Using
these functions, the administrator can manage the state of dish sale.
Add Employee Info
Properties:
" Login Account
" Login Password
20(82)
" Repeat Password
" Employee Name
" Employee Photo
" Id Number
" Birthday
" Address
" Telephone
" Email (optional)
" Degree (optional)
" School (optional)
In the Employee Management module, the administrator can view the information
of existing employees in the company by clicking “Employee Manage”. The
functions of “Add“ and “Modify employee“ are also provided in the project. The
employee accounts added can be used to log in this background management
platform. In addition, according to the real request, when an employee leaves the
company, the administrator can mark leave for this employee using “Mark Leave”
function, it means that the employee account will be invalid to log in the
background management platform.