You are on page 1of 33

Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

Contemporary Problems Of Mathematics


<<General Course Website System>>
Software Design Specification

Performed by: Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

Group №: ПОИТ-163

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

Date: 23/11/2018

Version: 1.0

Yanka Kupala State University of Grodno, 2018

Content
1. Project Introduction....................................................................................................1
1.1. Project development background....................................................................1
1.2. Project Overview.............................................................................................2
1.3. Technical Introduction.....................................................................................2
2. Aims and Objectives..................................................................................................3
3. Detailed Analysis and System Design........................................................................4
3.1. Function Introduction......................................................................................4
3.1.1. Messages Management........................................................................4
3.1.2. Articles Management...........................................................................4
3.1.3. Review Articles....................................................................................4
3.1.4. Authority Management.........................................................................4
3.1.5. Modules Management..........................................................................5
3.1.6. Personnel Management........................................................................5
3.1.7. Code Table Management......................................................................5
3.1.8. Role Assignments.................................................................................5
3.1.9. Roles Management...............................................................................5
3.2. System User Role............................................................................................7
3.3. Project Structure and UML Diagrams.............................................................8
3.3.1. System Architecture.............................................................................8
3.3.2. User Case.............................................................................................9
3.3.3. Activity Diagram................................................................................13
3.3.4. Sequence Diagram.............................................................................14
3.3.5. Class Diagram....................................................................................18
3.4. Background Management Design.................................................................19

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3.4.1. How It Works?....................................................................................19


4. Implementation........................................................................................................21
4.1. Sample Implementation................................................................................21
4.2. Database Tables Implementation..................................................................24
4.3. Code Implementation....................................................................................26
4.3.1. Java Code...........................................................................................26
4.3.2. JSP Code............................................................................................27
4. Summary..................................................................................................................29
5. REFERENCES AND BIBLIOGRAPHY................................................................30

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

1. Project Introduction

1.1. Project development background

The boutique course website is a relatively necessary content for the development of
quality courses. The development of each good quality course website is of great
significance in the course of each university.

In the development process of the boutique course website, there are generally some
errors in this way or another, to explore how it appears, and to design such a
universal, high-quality course website that can be quickly generated, maintained and
innovated, and then proposed the corresponding recommendations.

With the development of science, the excellent course website is a new teaching mode
under the new environment. The boutique course website is a highly interactive
website where administrators upload course resources and students download sites
that learn and discuss issues together. Studying on the boutique course website allows
students and teachers to interact and learn from each other.

In the context of the boutique course website, administrators can easily upload various
course resource information to the network. This will greatly improve the efficiency
of teaching and increase the enthusiasm of students for learning. Therefore, it is
necessary to develop such a set of quality course websites by using JSP with better
extension and MySQL database and Eclipse as development tools.

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

1.2. Project Overview

The general course website system is mainly used for college students and teachers to
browse the specific introduction of each course, teaching team, course-related
activities and curriculum resources, and can also ask questions or answer questions
about a course and write articles related to the course.

1.3. Technical Introduction

-JSP
JavaServer Pages(JSP) is a technology that helps software developers create
dynamically generated web pages. Tags usually begin with <% and end with %>
[WK01].

-Servlet
A Java servlet is a Java software component that extends the capabilities of
a server [WK02]. 

-HTML
Hypertext Markup Language (HTML) is the standard markup language for
creating web pages and web applications [WK03]. 

-CSS
Cascading Style Sheets (CSS) is a style sheet language used for describing
the presentation of a document written in a markup language like HTML [WK04].

-JavaScript
JavaScript, often abbreviated as JS, is a high-level, interpreted programming
language. It is a language which is also characterized as dynamic, weakly
typed, prototype-based and multi-paradigm [WK05].

2. Aims and Objectives

The purpose of this software is to develop a curriculum management system for


students to select courses and teachers to upload relevant course materials. Teachers

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

and students display different information in the background according to their


different roles. This can be done, combined with the relevant tree structure design
module, according to the role of the different from the database to find relevant
information.

To accomplish this task, set the following goals


1. Analyze the structure of the system
2. Make Mockup and design the relevant UI interface
3. Search for appropriate permission management function implementation
4. Found defects in the existing permission management allocation
5. Select the appropriate programming language to implement the system
6. Tested the system, found relevant bugs and deficiencies and improved them

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3. Detailed Analysis and System Design

3.1. Function Introduction

3.1.1. Messages Management

Administrators and teachers can view all the message information, and some of
the illegal messages from the message area deleted, so that the message is not
displayed on the front page.

3.1.2. Articles Management

Articles submitted by the front-end users will display all the information in the
background, the administrator and teachers can view the specific content of the
article, and can edit and delete.

3.1.3. Review Articles

After the article written by the user is submitted, the background administrator
and the teacher review it. Only after the review, the article can be displayed on
the front page for the user to read.

3.1.4. Authority Management

The authority allocation of the background module by the super administrator for
all roles is only accomplished at present, and it is not detailed to buttons, tables
and so on.

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3.1.5. Modules Management

The administrator who has the right to operate on all modules can add, delete,
change and check the modules in the module management, and part of the
module information (such as routing address, etc.) will serve as the important
information of the background permission management.

3.1.6. Personnel Management

The administrator can manage the basic information of the personnel, can add,
view and delete and lock operation, all the login personnel of the system are
managed here.

3.1.7. Code Table Management

Code table will save some scattered information, such as the display of
information such as the drop-down box. This information can be added, deleted,
modified and checked here.

3.1.8. Role Assignments

Super administrators assign roles to users, assign a certain role to a certain user,
or to several users, and users with this role can operate with the permissions that
this role has

3.1.9. Roles Management

Super administrators can manage roles, add roles, remove roles, modify role
information, and view role information.

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3.2. System User Role

Users of this system are divided into teachers and college students and the system
super administrator.

1. Student
Students can publish articles and leave messages on the course in this system.

2. Teacher
Teachers need to know the basic operation of the computer, can browse the
relevant information of the course, and ask and answer questions, and can
publish their own articles on the study of the course, and manage and review
the articles and users.

3. Administrator
Administrator, need to be familiar with the system, master the system
function flow; He has the highest authority of the system, in addition to being
able to have the authority of students and teachers accidentally, but also can
add, delete, check, change the personnel, role, authority, can assign each user
the authority of the system.

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3.3. Project Structure and UML Diagrams

3.3.1. System Architecture

PIC 1. System Architecture Diagram

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

The architecture of the project shows the framework deng needed to be implemented
by the system

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3.3.2. User Case

UC 1. Login User Case

2) Personnel Management User Case

UC 2. Personnel Management User Case

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3) Article Management User Case

UC 3. Article Management User Case

4) Column Management User Case

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

UC 4. Column Management User Case


5) Permission Management User Case

UC 5. Permission Management User Case

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

6) Module Management User Case

UC 6. Module Management User Case

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3.3.3. Activity Diagram

AD 1. Activity Diagram

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3.3.4. Sequence Diagram

1) Administer:

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

SD 1. Administer Sequence Diagram


2) Teacher:

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

SD 2. Teacher Sequence Diagram


3) Student:

SD 3. Student Sequence Diagram

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3.3.5. Class Diagram

CD 1. Class Diagram

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

3.4. Background Management Design

Before the presentation, because all modules of the management system are roughly
the same, all contain add, delete, change and check, here we extract the most
important module in the background -- Permission Management for explanation.

Some of the conditions required to implement permission management:


1. Understand the permission management mode
2. Resource-based access restrictions
3. Flexibility of front-end code
4. Calculation and processing of the increase and modification of back-end code
5. Database table design

These are the most important to achieve permission management, the following we
explain the design idea of permission management

3.4.1. How It Works?

We don't use a permission management framework, just JSP and Servlet, so


permission management isn't broken down to very granular levels.

The first step is to understand what permission management is and how it works.

In this project, the authority management is considered to be different according to


the user's different roles, and the module to be managed in the background is
displayed differently.

For example, the teacher enters the background, because the teacher can manage
the student's information, such as the student's score or the paper written by the
student, so the teacher has higher authority.

And the permissions always need to be assigned by a person, and these people
always need to be managed by a role. At this time, the role of super administrator is
generated. Super administrator needs to manage more information, so it has higher
permissions.

So, the permission management here is based on the information displayed by


different role types, and how to design?

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

4. Implementation

4.1. Sample Implementation

There are three interfaces shown by different roles, namely administrator, teacher
and student.
1) Administrator:

SAD 1. Admin Interface

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

2) Teacher

SAD 2. Teacher Interface

3) Student

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

SAD 3. Student Interface

According to the picture, the interface displayed by different characters is different,


so we have to think about how to design the database table.

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

4.2. Database Tables Implementation

We first need to consider the role table.

TABLE 1. Role Table


Field Name Field Type Field size Is it empty Remarks
id int 50 no role id
role_name varchar 100 no role name
create_time datetime 0 no creation time
is_delete tinyint 1 no 0 not deleted 1 deleted
remark varchar 250 yes Remarks

Then we need to think about how to save the modules. According to the design,
what is shown on the left is our modules, and there is an inheritance relationship
between modules, such as Personnel Management included in the System Settings.
TABLE 2. Module Table
Field Name Field Type Field size Is it empty Remarks
id int 50 no Module id
module_code varchar 50 no Judging module parent-
child relationship
based on coding
module_name varchar 50 no Module name
module_path varchar 250 yes Module routing
parent_code varchar 50 yes Parent node encoding
is_menu tinyint 1 no Is it a menu?
level varchar 20 no Level 0 0-0 0-0-1
create _time datetime 0 no Module creation time
is_delete tinyint 1 no delete or not
remark varchar 250 yes Remarks

According to the table, each module has a module code and a parent code. For
example, if Personnel Management is the child node of System Settings, then the
parent module of Personnel Management is the System Settings and the parent

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

module code of system Settings.


System Setting:
module_code: 00001
parent_code: null
Personnel Management:
module_code: 0000100001
parent_code: 00001
Module Management:
module_code: 0000100002
parent_code: 00001

We also need a table for the modules that each role can use, so we need an
intermediate table.

TABLE 3. Module_Role Table


Field Name Field Type Field size Is it empty? Remarks
id int 50 no Module role id
role_id int 50 no Role id
module_id int 50 no Module id
create _time datetime 0 no Module creation
time
is_delete tinyint 1 no delete or not
remark varchar 250 yes Remarks

This allows us to save and read modules that are available to different roles.

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

4.3. Code Implementation

After we design the database, we need to think about how to present it in the
foreground and how to automatically generate module code when adding
modules.

How to automatically generate module code?


Our module code is a multiple of the first five digits of 0, and there are two
possibilities for adding or modifying it:

 If it is the highest level module, get all the highest level modules, then delete
the 0 and calculate the number, then add the number one, and then add the
previous 0 to five.

 If it is a sub-module of the parent module, it needs to find all the sub-


modules in the database according to the parent module, and then sort the
sub-modules according to the module code of the sub-module, calculate the
number with the last deletion of 0, and then add the number one, and then
add the preceding 5 parent module code and 0 until there are ten digits.

4.3.1. Java Code

if(parentCode.equals("") || parentCode == null) {


parentCode = null;
ArrayList<Module> list = new ModuleImpl().getNullParentCode();
if(list.size() == 0) {
lastCode = "00001";
} else {
lastCode = list.get(list.size() - 1).getModuleCode();
lastCode = lastCode.substring(lastCode.length() - 5,
lastCode.length());
lastCode = StringUtil.addANumberByString(lastCode);
}
} else {
ArrayList<Module> parentChilds = new
ModuleImpl().getByParentCode(parentCode);
if(parentChilds.size() == 0) {
lastCode = "00001";

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

} else {
lastCode = parentChilds.get(parentChilds.size() -
1).getModuleCode();
lastCode = lastCode.substring(lastCode.length() - 5,
lastCode.length());
lastCode = StringUtil.addANumberByString(lastCode);
}
}
if(parentCode != null) {
lastCode = String.valueOf(parentCode) + "" + lastCode;
module.setParentCode(parentCode);
}

/**
* Gets the encoded plus one string
* @param code
* @return
*/
public static String addANumberByString(String code) {
String result = "";
// Keep the number of bits of code
result = String.format("%0" + code.length() + "d", Integer.parseInt(code)
+ 1);
return result;
}

Here we have implemented the module management content, and the next step is to
show the different modules according to the roles, where JSP code is more needed.
JSP Code

4.3.2. JSP Code

<ul id="menu">
<%
ArrayList<Module> parentModule = new ArrayList<Module>();
for(int i = 0; i < modules.size(); i++){
if(modules.get(i).getModuleCode().length() == 5){
parentModule.add(modules.get(i));
}

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

}
for(int i = 0; i < parentModule.size(); i++){
%>
<li>
<a href="javascript:void(0);"onclick="doMenu(this)">
<%=parentModule.get(i).getModuleName() %>
</a>
<ul>
<%
for(int j = 0; j < modules.size(); j++){

if(modules.get(j).getParentCode().equals(parentModul
e.get(i).getModuleCode())){
%>
<li>
<a href="<%=basePath %><%=modules.get(j).getModulePath() %>"
target="innerFrame"><%=modules.get(j).getModuleName() %></a>
</li>
<%
}
}
%>
</ul>
</li>
<%
}
%>
</ul>

We use ArrayList to obtain modules corresponding to this role, and then use <a
href="<%=basePath %><%=modules.get(j).getModulePath() %>to access modules
dynamically, which is some of the algorithms used for Module Management and
Permission Management.

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

4. Summary

This project has designed a course selection system, and this document mainly
explains the background management system.

From this document, we can find the development background of the project, the
structural design of the project, the realization of some major functions such as
functional design.

We need to solve some problems from different thinking, don't fix ourselves in a
directional thinking. And the software we need to do is the same, it needs to change
dynamically, not always show the same picture. That way, developers have a clearer
idea of how to program and solve problems faster.

©Copyright 2018. GCWS All Rights Reserved.


Hank (Ло Синхань) & Hoen (Хэ Эньцзян)

5. REFERENCES AND BIBLIOGRAPHY

[WK01] Java Server Pages, Wikipedia Encyclopaedia (Electronic Source: URL:


https://en.wikipedia.org/wiki/JavaServer_Pages, Visited on: November 20, 2018)
[WK02] Java Servlet, Wikipedia Encyclopaedia (Electronic Source: URL:
https://en.wikipedia.org/wiki/Java_servlet, Visited on: November 20, 2018)
[WK03] HTML, Wikipedia Encyclopaedia (Electronic Source: URL:
https://en.wikipedia.org/wiki/HTML, Visited on: November 20, 2018)
[WK04] CSS, Wikipedia Encyclopaedia (Electronic Source: URL:
https://en.wikipedia.org/wiki/Cascading_Style_Sheets, Visited on: November 20,
2018)
[WK05] JavaScript, Wikipedia Encyclopaedia (Electronic Source: URL:
https://en.wikipedia.org/wiki/JavaScript, Visited on: November 20, 2018)

©Copyright 2018. GCWS All Rights Reserved.

You might also like