Database Naming Design Specification

1. The database involves character specification

Use 26 English letters (case sensitive) and ten natural numbers 0-9, plus underscore '_', a total of 63 characters. No other characters (except comments) can appear.

Precautions: 

1) The above names must not exceed the system limit of 30 characters. The length of variable names is limited to 29 (excluding the identifying character @).

2) The names of data objects and variables use English characters, and Chinese names are prohibited. Never leave spaces between the characters of the object names.

3) Be careful with reserved words, to ensure that your field names do not conflict with reserved words, database systems or common access methods.

4) Maintain the consistency of field names and types, and ensure consistency when naming fields and assigning data types to them. If the data type is an integer in one table, don't change it to a character type in another table .

2. Database naming convention 

Databases are named directly using application or system names.

For example: paper (paper system)

The backup database name is composed of the official database name and the backup time.

Such as:

paper_20070403

 

3. Database table naming convention

The data table name is composed of lowercase English and underscores, as far as possible to indicate which application or system is using. (It is easy to distinguish different projects using tables in the same database)

The data tables of related applications use the same prefix. For example, the forum tables use the cdb_ prefix, and the blog data tables use the supe_ prefix. The prefix name generally does not exceed 5 characters.

比如: paper_user paper_group paper_userspace 

The name of the backup data table is composed of the official table name and the backup time.

Such as:

paper_user_20070403

paper_group_20070403 

paper_userspace_20070403

 

4. Field naming convention

 

The field names generally use nouns or verb-object phrases, and the field names are lowercase. The database field names are all lowercase English words, and the words are separated by "_". The field names are named according to their actual meanings.

Note: Comment all field names

Such as:

sex (sex) 

is_good (whether excellent)

In the case of foreign keys, the method of "table name_id" is used,

Such as:

user_id(关联用户表的id)

 

项目命名设计规范

1.命名规范

1、 项目名全部小写

2、 包名全部小写 (公司名称.开发组名称.项目名称.模块名称)

3、 类名首字母大写,如果类名由多个单词组成,每个单词的首字母都要大写。(模块+Acion/Service/Dao 如:CourseAction)

如:public class MyFirstClass{}

4、 变量名、方法名首字母小写,如果名称由多个单词组成,每个单词的首字母都要大写。

如:int index=0;

public void toString(){}

5、 常量名全部大写

如:public static final String GAME_COLOR=”RED”;

6、所有命名规则必须遵循以下规则:

1)、名称只能由字母、数字、下划线、$符号组成

2)、不能以数字开头

3)、名称不能使用JAVA中的关键字。

4)、坚决不允许出现中文及拼音命名。

7.jsp命名规范是用下划线,一般不用大写的。

纯jsp开发情况下

1).  全部采用小写的英文字符和”_ ”组成。

2).  整体采用模块名+操作的形式。如:user_view.jsp

使用mvc框架开发情况下

 Jsp页面尽可能与action里面的方法名一一对应,以文件夹的形式区分模块,如ProjectAction 对应project文件夹下的页面,增删改查涉及的方法名有以下几个:

(add save)(delete)(edit update)(index)  

对应的jsp页面有add.jsp edit.jsp index.jsp

下面是相关项目结构截图

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326096530&siteId=291194637