Introduction: Kent Beck once said, "I am just a more payable programmer" "
table of Contents:
Foreword
Illustrative document specification
Process annotation
Function Note Specification
Naming conventions
Design specification:
Foreword
: 1.
Design specification importance
:
reason
N
many
,
Not in many
2. Applicability of this article: VB.NET development ASP.NET development
Comment code's goal:
1. Narrative Clear] The role of code (what to do, not how to do)
2. Clearly explaining the ideology and logic to express
3. Indicate the important turning point in the code
4. Reduce code readers run in their brain analog code
Note: Note that you should explain the purpose of the code, don't narrate how to complete the target's structure, you have to do so, not how to do it.
Use of special characters identify the comment: '$' @ at the beginning of the line representing commented code written by different people
One. Illustrative document specification (written on each .vb end of each .vb, indicating the function of the entire file)
1.1 in '---------------------------------- start and end
1.2 File Name: File Name
1.3 Author Version Version: Date and Completion Date:
1.4 DESCRIPTION: Used to specify the main feature completed by this program file, with other modules
Or function of the interface, output value, value range, meaning and parameters
System, order, independent or dependency, etc.
1.5 Others: Description of other content
1.6 Function List: Major function list, each record should include a function name and function brief description
1.7 History: Modify a list of history, each modified record should include a modification date, modify
And modified content brief description
1. Date:
AUTHOR:
Modification:
2. . . . . . . . . . . .
two. Process annotation
2.1 in '---------------------------------- start and end
2.2 DESCRIPTION: Function Description
2.3 Parameters: Parameter Description
2.4 Calls: Functions or procedures called by this process
2.5 Called By: Call the function list of this process
2.6 Table Accessed: Acuted tables (this item only involves the database operation)
2.7 Table Updated: Modified table (this item only involves the database operation)
three. Function Note Specification
3.1 Function: Function Name
3.2 Description: Description of Function, Performance, etc.
3.3 Calls: Functions called by this function
3.4 Called By: Call the function list of this function
3.5Table access: // Access table (this item only involves the database operation)
3.6 Table Updated: // Modified Table (This item only involves the database operation)
3.7 Parameters: // Input parameter description, including each parameter
// Use, value, and parameters.
3.8 RETURN: / / Function return value
Four naming regulations
4. 1 naming specification
(1) Ordinary control
Name Prefix sample ADROTATOR ADRT ADRTTOPAD
Button BTN BTNSUBMIT
Calendar Cal Calmeetingdates
Checkbox Chk Chkblue
CheckBoxlist Chkl Chkfavcolors
CompareValidator Valc Valcvalidage
CustomValidator Valx Valxdbcheck
DataGrid DGRD DGRDTITLES
DataList DLST DLSTTTLTLES
DRIOPDOWNLIST DROP DROP
Hyperlink Link Lnkdetails
Image IMG IMGAUNTTTY
ImageButton IBTN IBTNSUBMIT
Label LBL LBLRESULTS
LinkButton LBTN
Listbox LST
Panel PNL
Radiobutton Rad
RadopButtonList Radl
Rangevalidator Valg
RegularExpression Vale
Repeater RPT
RequiredFieldValidator VALR
Table TBL
TableCell TBLC
TableRow TBLR
Textbox txt
Validationsummary Vals
XML XMLC
(2) ADO.NET control naming
Connction ConnorthWind (CON Database Name)
Command cmd cmdreturnproducts
Parameter PARM PARMPRODUCTID
DataAPter Dad Dadproducts
DataReader DTR DTRPRODUCTSDataSet DstnorthWind
DataTable DTBL DTBLPRPDUCTS
DataRow Drow Drowrow98
Datacolumn DCOL DCOLPRODUCTID
DataRelation Drel DrelmasterDetaril
DataView DVW DVWFILTEREDPRODUCTS
(3) Target named by variables:
1. The use of variables is explicit 2. The data type and visible range of each variable are clearly clear 3. Make the process in the code is easy to understand 4. Make the program easy to debug 5. Make storage and processing of variables more effective
The rest of the VB.NET programming specification (2)