Design Specification series (brief)-class naming rules, database naming rules, page file naming rules

Source: Internet
Author: User

I. Class naming rules
1. entity layer:
Inheritance relationship: All classes are inherited from basicentity. Among them, basicentity implements the java. Io. serializable interface;
Naming rules: class name = Object + class suffix, where class suffix is Bean, for example, salesorderbean
2. form layer:
Inheritance relationship: All classes are inherited from basicform. Because this project is based on the struts structure, baseform inherits from validatorform;
Naming rules: class name = Object + class suffix, where class suffix is form, for example, salesorderform
3. Action layer:
Inheritance relationship: All classes are inherited from basicaction, where basicaction implements unified action-layer exception handling;
Because this project is based on the struts structure, baseaction inherits from dispatchaction;
Naming rules: class name = Object + class suffix, where class suffix is action, for example, salesorderaction
4. logic layer:
Inheritance relationship: All classes are inherited from basiclogicobject. Among them, basiclogicobject implements unified Exception Handling and permission check at the logic layer. Why should we check permissions at this layer, it mainly takes into account the upgrade needs when providing SOA services in the future;
Naming rules: class name = Object + class suffix. The class suffix is logic, for example, salesorderlogic.
5. Biz layer:
Inheritance relationship: All classes are inherited from basicbizobject, where basicbizobject implements unified handling of biz layer exceptions;
Naming rules: class name = Object + class suffix, where class suffix is biz, for example, salesorderbiz
6. Dao interface layer:
Naming rules: class name = Class prefix + Object + class suffix, where class prefix is I and suffix is Dao, for example: isalesorderdao
7. DAO implementation layer:
Inheritance relationship: All classes are inherited from basicdaoobject. Among them, basicdaoobject implements unified processing of Dao layer exceptions;
Naming rules: class name = Object + class suffix, where class suffix is impl, for example, salesorderimpl

 

Ii. Database naming rules

1. database tables
According to the sub-system/module to which the table belongs, the naming method is as follows:
Database Table name = subsystem/module abbreviation + Table meaning
The first letter of the sub-system/module is capitalized, and the first letter of each word in the table meaning is capitalized.

Subsystems/modules and their abbreviations should be described in the agreed section of the Database Design Manual.

For example, if the code table uses the "code" as the table prefix, code_area indicates the region code table.

2. Table fields:
In the conceptual model, each database defines a unique abbreviation for each table, with a length of 4 ~ 8 characters,
Field name = TABLE abbreviation + "_" + field meaning.
For example, if the prefix of a region code table field is "area", its field name is:
Area_id: Primary Key of the region code ID
Area_name: Region code name

Database table names and abbreviations should be described in the database design manual.
3. Index
Index name = idx + "_" + Table abbreviation + related fields/index meaning
4. Association
Association refers to the foreign key relationship between database tables.
Association name = RL + "_" + master table abbreviation + slave table abbreviation
5. Stored Procedure:
Stored Procedure name = proc + "_" + stored procedure includes

 

Iii. page file naming rules:

1. Directory naming principles

Ø case: the first letter of the directory name is lowercase, and other letters can be big;

Ø layering principle: tiles is the root directory of the page file. Sub-directories are created under the root directory based on the functional sub-systems. Sub-directories can be created under the functional sub-directories based on functional modules;

Ø public page: the directory of the Public page under the subsystem or function module is generally named component;

 

2. jsp file naming principles

Ø case: the first letter of all files is capitalized;

Ø name: Based on the page function, generally it is: Operation Action + operation object, where the first letter of the operation object is capitalized;

Common Operations:

New

Edit: Edit

View: View

List: List

Approval: Audit

Confirm: Confirm

Query: Query

Select: choice, which is usually used for pop-up;

Statistics: stat

 

Ø Special Handling

Sometimes an operation may have different sources or different purposes. In this case, the file suffix is added with a connector such as "from" or "for" and a source object. For example, the page name for generating a sales return ticket based on the sales order is newsalesreturnfromsalesorder. jsp.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.