This standardized document mainly targets the existing technologies and development directions of China's university work-study websites (hereinafter referred to as "work-study") and provides detailed standards for the development of website background programs, it is only for reference and learning by online programmers of zhongqin.
This document is divided into two parts: 1. Program Development standardization, which aims to standardize the standards of all operations performed by programmers in their work processes; 2. program management standardization, its significance is to standardize the management, assessment, training, rewards and punishments of programmers.
I. [Program Development Quality standardization]
1. Development Environment
At present, the specific development, debugging, and running environments of zhongqin online are basically:
Procedure: ASP 3.0
Platform: Win2k SERVER + IIS 5.0
Database: Access 2000/XP
With the continuous development of the website, the development, debugging, and running environment is no longer suitable for the technical requirements of a large educational website. The program language exposes the following phenomena: insufficient security, poor scalability, poor portability, and chaotic code. As a result, it is almost difficult for developers to modify and update previous programs, not to mention cross-platform applications. The Web platforms of Win2k and IIS 5.0 are not stable enough, the frequent occurrence of "server-as-you-go" is too high. The ACCESS database is slow in retrieval of large data volumes, and the data backup operations are cumbersome, which is not conducive to data synchronization between multiple servers in the future.
In order to improve the technical content of the zhongqin online service and keep up with the pace of international mainstream website development, the website is currently facing major reforms, abandoning the path of program development in the past (using programming languages ), in a timely manner in line with mainstream international standards (using object-oriented programming languages), we have two development environments available for choice:
1. Use the Linux + resin/Apache + JSP (Java) + Oracle/SQL server environment solution;
2. Use the Win2k + IIS (including. NET Framework) + ASP. NET (C #, VB.net) + SQL Server/Oracle environment solution;
In foreign countries, the first set of solutions has become the mainstream, widely used in the e-commerce field, and has a stable development. The second set of solutions has been launched in Microsoft. NET, with a bright future.
First of all, according to the statistical analysis of detailed data of developers since the establishment of zhongqin online, 90% of the online background program developers are non-computer undergraduate students and 10% are computer undergraduate and graduate students, however, due to the nature of its website, it is very unlikely that it will develop into a professional portal website for the broad community, and its developers may have been limited to students, especially non-computer students who are interested in network development. Therefore, the development team may always have shortcomings with insufficient Foundation. To flexibly master Java programming in Linux, most developers are still used to program development in windows, and ASP developers who have some experience are also expected, learning Asp.net is faster than learning java. The key is to change the concept from program-oriented to object-oriented. This is the first reason why zhongqin online should choose the second solution.
Second, at the beginning of the website, the development language used for medium-term program development is ASP. At present, it is difficult for ASP to be transplanted to the Linux environment, converting existing columns into JSP programs is a huge project in Linux, and the workload is no less than re-developing a complete system. Let's look back at the second set of solutions. asp and Asp.net can coexist in the new development environment. As a result, this site can be without affecting normal development and operation, at the same time, the original ASP program is upgraded and transformed into a new Asp.net program, and the program execution efficiency and the overall technical content of the website are gradually improved in parts, so that the development and operation are truly correct, this is the second reason why zhongqin online should select the second solution.
To sum up, zhongqin online should select the second development environment, and gradually implement technological transformation and improvement in the object-oriented development direction.
2. Efficient principles
As a programmer, no matter which field of program development, efforts should be made to pursue program efficiency. Please pay attention to the following:
"Don't think that the CPU computing speed is fast, so we will push all the problems to it. programmers should optimize the code and never let the CPU do what we can do, because the CPU serves users rather than our programmers!"
For the web development of zhongqin online, we instantiate this sentence:
· Avoid using a large number of global variables as much as possible and delete useless variables;
· Use as few session variables as possible;
· Use stored procedure paging whenever possible when the data volume is large;
· Use "select *" as few as possible. Even if all fields are required, list them one by one in the order they are used. Use the index creation or primary key field sorting in advance when order by is used;
· When using the request object, write the querystring method or Form Method for the specific situation;
· All Database and file objects should be closed as early as possible after use, and nothing should be assigned at the same time
· In ASP. NET development, we should minimize the use of system controls that consume large resources and use codebehind technology whenever possible to separate code from pages and compile dynamic link library files;
Use the SQL Server database whenever possible;
3. coding conventions
At present, zhongqin online has been operating normally for more than three years. programmers have continued from 9 to 7 undergraduate students until now, and the degree of familiarity with coding for programmers of all levels is different from that for coding, as a result, the program code is varied. Strictly speaking, from the current back-end program code of the website on the official website, the official website on the official website remains at the individual website level, we cannot see the proper standards of a large educational website. Therefore, our programmers must adopt a unified coding method. One of the reasons can reflect the integrity of the entire website, it can improve the readability of the program and facilitate the programmers in the next stage to modify and update the program. The specific content is as follows:
1. Define the variables before using them;
2. Use English letters to describe the first letter. Do not use Pinyin letters;
3. variable naming rules are basically adopted in Hungary;
The basic principles of Hungary naming rules are:
Variable name = property + Type + Object Description
That is, a variable name is composed of three pieces of information, so that programmers can easily understand the type and purpose of the variable and make it easier to remember.
Below are some examples of the recommended rules on our site (for detailed naming rules, see Hungary naming rules ):
· Attribute section
Global variable: G _
Constant: C _
· Type
Finger needle: P _
Statement handle: H _
Integer: I _
Floating Point: F _
Date type: D _
Boolean: B _
Character Type: S _
Number Group: ary _
· Description
Initial: init
Temporary Variable: TMP
Some of the rules take into account the C # variable naming rules developed by. net in the future, not in ASP.
Reference instances: c_ I _initbordercolor, g_s_tmpnewstitle, and g_ I _ary_votenum. programmers can modify the settings based on actual conditions, but they must follow the Hungarian naming rules, allows other programmers to view variable names to know the meanings of key identifiers such as their types and attributes;
4. the attribute values of all controls must be enclosed in double quotation marks or single quotation marks;
5. Control naming rules:
Button: BTN
Form: FRM
Select: Sel
Textarea: txt
Input: IPT
Hidden: hid
6. Main rules for use of various controls:
· IMG Control
ALT: all display images must have a text description that briefly describes the image content.
· Input control
Maxlength: Specifies the maxlength attribute for all input controls. The default value is the length of the corresponding field in the database.
Readonly: The readonly attribute must be used for all unchangeable information.
· Form Control
Action: action must be specified for all forms. If submitted to itself, Action = "" is specified ""
Method: Try to use the post Method
Onsubmit: All forms must specify the check programs required before submission.
All forms must have corresponding reset buttons.
· Button control
Onclick: the button used for submission in form does not allow this method. All data checks are activated through form's onsubmit.
· Head attributes
All pages must have a head attribute that is not empty.
· Add the following statement to all Chinese pages:
<Meta http-equiv = "content-language" content = "ZH-CN">
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
4. Database Design
Before designing a database, programmers should carefully read the analysis documents (including feasibility analysis and Requirement Analysis) prepared by the marketing department and view the list of functions required by the project prepared by the Information Department, after careful consideration, perform preliminary database design and submit the database design report after design. The detailed specifications are as follows:
· All Tables must start with the character "T" (table), such as tusers, taffriches, and tmessages;
· Therefore, the field must start with the character "F" (field), such as the field FID, fname, and ftitle;
· In important tables, at least two reserved fields are created, named fpre_int (numeric type) and fpre_str (numeric type );
· The ACCESS database should have a long database file name or be negotiated with the network Department to establish an ODBC connection to prevent unauthorized database downloads.
· To design an SQL Server database, you should also back up the database and create an SQL script, that is, back up the database structure.
Basic Database Design
5. Folder settings
With the development of zhongqin online, more and more columns are set up. After three years of development, more than 10 columns are available, and each column is developed by different personnel, the folder settings for each topic are also 7-to-8 chaotic, and it is difficult for other developers to clearly understand the column structure. Therefore, to better standardize the setting of programs and page folders, the following rules are provided:
· The Connections folder must be provided to store database connection files;
· The INC folder must be provided to store including files and other page calling programs;
· You must have an images folder to store image files;
· A css folder must be provided to store style sheet files;
· You must have a doc folder to store development documents;
· The original Files folder must be provided to store image source files;
· A js folder must be provided to store script files;
· In the columns with the upload function, you must have an upload folder to store uploaded images and files;
· In the ASP. NET column, you must set the source folder to store the program C # Or VB.net source files;
· In the ASP. NET column, you must set the bin folder to store dynamic connection library files;
· To use the SQL Server library column, you must set an SQL folder to store the SQL script file of the database structure;
· You must set the backup folder to store the pre-update backup files.
6. Comments and indentation
In the past development, most of the online applications of zhongqin were ASP scripting languages. These language programs are nested with pages and are usually called "Pasta" code, so reading the program often takes a lot of time. in net development, codebehind technology can be used to separate code from pages, which can reduce the burden on programmers to a certain extent, but it is necessary for programs to read code more quickly, you must also add comments to the appropriate part, and use code indentation properly. Code indentation should be used between modules, cyclic blocks, and conditional blocks, the first level of indentation is two spaces.
7. Security and debugging
After the development stage, the programmer is also responsible for code debugging and funnel detection tasks, including the following content:
· All pages must run at 800*600,102 4*768 resolution;
· All pages must run in ie5.0, 5.5, and 6.0 without JavaScript errors;
· All operations involving deletion must be confirmed after the user is selected;
· Check SQL vulnerabilities and each passing parameter to eliminate the possibility of intrusion;
· After the development is completed, it must be attached to the work data center for internal debugging for one week before it can be officially released;
Ii. [Program Development Management Standardization]
1. Project Management
In general, the Development Department is fully responsible for program development. The Development Department allocates programmers to various project teams based on the current human resources. Each project team must set up a team lead to take charge of the progress of the entire project. First, draw a project schedule, and project operation procedures and necessary development documents. The project leader prepares weekly reports, which are reviewed and reviewed by the development minister and specifies the weekly seminar time. The project leader records the details at least twice a week. For specific operations, see project development quality and management standardization.
2. Rewards and Punishments Mechanism
The project leader must check the program developed by Members every week, strictly follow the standardized implementation of program development quality, make records, make weekly statistics on weekly reports, and give score to the team members each week, and submit them to the minister for consultation. After the project is developed, all the members of the project team must discuss and check each other and make the final modification. The project leader submits the project team's Development stars, and the bonus is reflected in the current month's salary. In addition, the project leader should give different comments to each employee based on the workload of each member, the efficiency of code writing, and the standard aspect, which is reflected in the project development document, so that the human resources department can inspect and issue compensation.