DOTNET Project Group Code Specification
BILL_FANG
2004-3-15
To develop a specialized software product, in the coding phase, you must strictly implement a certain code development criterion, which will reduce the implied error of the program while making the internal structure of the program. Thus, there will be a small error, the quality of maintenance, so that the team's teamwork and professionalization have greatly improved. This is a recognized criterion in software development and a specific application of software engineering in coding stages.
One. Program code comment
1. Head notes for stored procedures
Each stored procedure must write a comment, written at the forefront. Such as
/ *
Author: Bill
CREATE TIME: 2003-06-16 17:04
Last Modify Time: 2003-06-16 17:13
Version: 1.0.01
ACTION Describe:
Memo:
* /
2. Internal comment for the memory process
The internal needs of the stored procedure are added to add a comment, simply explain its function, design ideas, algorithms, and more. Such as:
/ * SET NOCOUNT ON * /
3. Head notes of the CS file
Each .CS file must write a comment, write the front of the CS file. Such as
/ *
File Name: ClientServices.cs
Storage Path: CapitalNet_Mis / EntityDao /
Author (author): Bill
Create Time (established date and time): 2003-06-16 17:04
Last Modify Time (final modification date and time): 2003-06-16 17:13
FILE VERSION (this file version number): X.x.xxx 1.0.01
File Action Describe (File Features Description): Customer Service Entity Access Layer
File Memo:
* /
4. Class note
Write detailed comments for your defined classes, including author, time, version revision, basic algorithms, such as:
///
/// Simple description
/// summary>
5. Comment of class members
Members of each class, such as variables, attributes, etc. are added to the corresponding annotations.
6. Note
Write detailed comments for each function you define, including input / output parameter description, return value description, function function description:
///
// / get the bill of this account
/// summary>
/// Contract Guid param>
/// This account date param>
///
Public Static ContractPaidListData CalculateThispaid (String ContractGUID, DateTime Date) {}
7. Notes within the code
Key code must be added, briefly explain its function, design ideas, algorithms, etc. Long strip annotation (division function module), short comments (see each step of implementation) combined with the sentence after explaining (indicating the meaning of important sentence), clear functionality. Such as:
// Draw the string as normal and let the three
/ *
This is a test
* /
1) Generally speaking, comment as needed, concise.
2) Modify the code's annotation, when there is a second person to start modifying the code, a comment should be accounted for each modified code section, must include modifying people, modifying the time, and can also include modifying purposes, etc.
8. Other points
1) Add a comment at the end of the range. Such as // for cycle ends.
2) Note must be concise and easy to understand.
two. Accessibility design of objects
1) Do not define the classes of PUBLICs, which is quite important in the development of components.
2) Only the functions referenced by other classes are defined as a PUBLIC type function.
3) It is best not to use the public type member variable in the class (generally used attributes).
4) It is best not to use global variables. Some replacement methods can be used.
three. Object naming specification
1. Naming request
1) All naming (class, functions, variables ..) require significance to clearly understand.
2) Avoid using the words such as the uncertain meaning of numbers directly in the code, try to use meaningful string values.
Example: protected const string capen_title = "Bind Data TO a ComboBox"
3) distinguish various variables and functions on the name.
2. Naming agreement
1) Constant naming rules. A composite word that is generally used in uppercaseness is generally defined.
protected const string capen_title = "Bind Data to a comboBox"
2) Field (variable), start opening a lower writing letter, the back of the meaningful English word begins in uppercase.
Public String Strname, etc.
3) Attributes, generally starting with uppercase letters, having certain significance.
Name;
4) Classified names, meaningful composite English words starting with uppercase letters. The meaning of this class is also considered for the definition of the class name.
For example, we divide the business rules, data, business interface, and data access layers, etc. in the project. I will give an Agent table to be named after processing in each layer:
AgentData - àagents - àagentr - àagentf (names: data entities, data access layers, business rules, business interface layers naming)
5) Naming rules of the control, the naming of the control can begin (lowercase), with a certain meaning in English; try to make abbreviations understand. Encountering new controls can be discussed.
such as:
Button: btnupate
DROPDOWNLIST: DDLSTCITY
Label: LBLNameDataGrid: Grdagent
DataList: DLstagent
TEXTBOX: TXTNAME
(and many more)
6) The name of the file name is starting with uppercase letters. DataAccess.cs
four. Definition and function description of data sheets
1) Definition of the basic table
Basic tables refer to database tables that provide basic data for business implementation with no direct relationships with business. This type of country, currency, unit (COMPANY), Contact, Product, Bank, and so on.
2) Maintenance features provided by the basic table
To provide addition, modify, delete, view, and so on for these basic forms. In these functions, the viewing function is important, to give multiple conditions for viewing features, so that you can view and reference the modules.
3) Definition of business table
Business table refers to database tables that are directly related to business, to save various business data, and implement database tables for various business functions, Contract, project, opportunity, contract fees (ContractPAIDLIST )and many more.
4) Maintenance features provided by business tables
To provide addition, modify, delete, view, and other maintenance functions for these business forms. Because these data are closely related to the business, a number of queries can be given. These services involve a lot of business logic, so you need to use the business logic layer to process the data in the business table.
(Endlessly)