My Web System Design specification

Source: Internet
Author: User

The following is my own work in the summary, for reference only.


• Trim () All user input to remove two spaces, if you want to use the space   escape instead, should not be in the JS trim (), but should be in the database or back-end control, and only in one block control, change the policy only one code.
• You should not use the frameset frameset, you should use an IFRAME instead of frameset, because frameset Page cannot execute JS, if you want to pop-up content on the frameset page is not possible.
• Avoid using int and long at the same time in your project, and use one type uniformly, because they are very inconvenient to convert to and from each other, and are prone to errors.
• Each page should contain a JS file that is globally controlled.
• Front-end design should consider an extended JS library, the methods and properties of JS native objects and events using prototype to expand, so that direct calls anywhere, should avoid writing third-party functions, the method should be extended include string ReplaceAll (), HashMap type, and so on.
• The same functionality is defined only once, and should be eliminated from duplicate definitions, which can cause code clutter and maintenance headaches.
• The front end should not be prompted with the JS built-in alert function, because alert displays in different browsers are not uniform, and will block the thread, not suitable for the existence of the timer program for the page to use. Third-party HTML controls should be used.
• By means of a GET method, if the value of a Boolean is passed in, it cannot be judged directly by = =, because get passes a string.
JS Judge the Boolean type as much as possible with ==true/false-specific values and avoid using the IF (!boolean) usage, because undefined, false, and Null may satisfy the condition.
• If the project uses AJAX, you should configure global Ajax event handling, such as jquery's Ajaxsetup, using the Before and Complate callback functions for speed monitoring, using the error function to implement the default error handling.
• If you need to design a multilevel association table (multiple tables exist cascading relationships), the child table, Sun Qua, preferably with the top-level table ID, so that the deletion is directly based on the ID delete the database itself or through the program Cascade Delete Performance is high.
• When adding a field to a database table, you must consider whether the field should create an index, a small amount of data in the test library, and a slow query efficiency when the amount of data on the online library is large.
• For more features, using the front-end resource cache, the system should design the dynamic request JS code and execute the function, to temporarily solve the front-end bug in the emergency. Dynamically request a action,action direct output JS code.
• Define common full-width half-width character substitution functions
• The code implementation must be strictly in accordance with the specification, according to the constraints, all the processing logic must write comments, and some of the examples should be an example, the data structure to indicate the data structure, the reason for writing reasons.
• Encode each function point and add coding annotations to the relevant code files and locations for easy function maintenance through the code of the IDE's quick location feature.
• Record the date time for each user login and log all operations.
• Front-end like to the background database to save data should avoid "null", "undefined", "NaN" and other JS generated stolen data into the library, otherwise it will affect the data analysis and calculation.
• Collection Data deduplication, front-end available obj[key]=value, background available hashmap, they all use key non-repetition mechanism to eliminate duplication, which is more efficient than write cycle and error-prone.
• Design should consider the impact of the system upgrade to the online users, should be left with the user in the upgrade to pop-up prompts for the channel function, that is, real-time push function.
• If you are using MVC or multilayer design patterns, pass parameters and get return values should be strictly according to the method call, parameter return specification, should not be used as in M to v parameter object, V method no return value, v modify Parameter object, M and then directly read the value in the Parameter object, should use M to the V parameter object, V processes and creates a return value variable, and the method of V returns the variable. Why did you do this? Because if you want to split the layers later, using remote calls, the M layer cannot refer to the parameter objects in V, they cross the machine, across the system, across the memory, and the references are invalid.
• When designing a Web form, the input box should have two attributes, an original value, a current value, which is used to determine which values have changed when saving, and should only update the changed fields, reduce the amount of network data transfer, and reduce the amount of database operations.
• If the page does not want to be cached, add it to the <meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Expires" content= "0" >
The JS file header should be defined by the encoding method, Utf-8.
• database table design, when business functions are saved, if there is a foreign key field, it is best not to reference the ID directly, you should create a unique field in the other table and reference that field. This is done in order to avoid the problem of handling IDs when the database is promoted, and to facilitate data correspondence and recovery in the event of a serious failure of the database.
The verification code is destroyed immediately after use, otherwise the user can repeatedly submit the data by illegal means.

My Web System Design specification

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.