Frog Frog Recommendation: Just wrote a development plan, everyone gives some opinions

xiaoxiao2021-03-06  115

Ø Create a good directory level: CLS directory off all business logic layers and global static classes; asmx directory off all web service files; ASCX directory off all user controls, Style drop style table; config directory Add a Web Profile, Script directory off all client scripts; Images Directory will be placed down; the admin directory off the background management file, and configure it under Web.config to allow anonymous access.

Ø Reminder:

N If you build a good folder or control, it is best not to change your name, sometimes it will cause a reduction in readability;

n In the.config file under the Config directory, you will correctly write a static class by web.config, and then write a static class in the CLS directory, and get these settings, use static properties to make external access, static methods and The attribute unit can be used by instantiation, like a database connection string, the number of records per page, the website style, etc. can be done;

n Put the product catalog and other relatively unchanged things in Global.asax, and build it, then make user control cache;

n Simple control is best to create data from DataTable, HashTable, ArrayList, etc., so good management, better than use items.add methods, to be flexible;

n uses commonly used open source components, such as AspUpload, FreetextBox, etc .;

N-string connection is best to use by StringBuild object;

n Package the operation of a particular object into a class and put it under the CLS folder as a business logic layer, such as writing a user, package add, edit, del, etc. to implement the management of the user. Encapstribute attributes such as Name, PSW, Mail to access the user's information, remember to import the namespace to the custom class, such as SQLCLILT, etc .;

n If there is no necessary DAL layer, it is written separately, because there are very few demands from SQLServer to Oracle, in one reason is that there is one of the intermediate layers.

n is good at using the user control to lay out the front desk, but the reporter allows the artist to set some properties such as the controls, color, etc. of the controls in some user controls, and the user control can add custom properties;

n is good at using the SWICH statement and:? statement instead of some if () {} else {} statement;

N ispostback's use;

N Multi-use client technology to maintain page status, such as cookies, hidden domains, query strings, view status, status protector, reduce the use of Application and Session, even if you want to use Application to do a good job in preventing deadlocks Measures, and ensure that the reapply, it is possible to ensure Application variables, such as deploying a database such as a database such as a database; if you want to use session, you'd better set the of the in Web.Config, or set it to Stateserver or SQLServer;

n Small using JS's Alert to prompt users, should be positioned with placeholder controls, use the Label control to display the output information, and then add it to the placeholder with the controls.add method;

n There is no need to use web services to do business logic;

N The coupling portion between each module is too robbed, minimizes the connection between the modules, enhances the scalability and scalability of the system; N uses the TRY () catch () block to protect the program;

n Sometimes I should use include instead of user controls, when it is simple;

n is good at using the IFRAMELAI layout page;

n is good at using ShowModalDialog instead of Window.Open ()

n Good at using XMLHTTP to submit form fire refresh update data, extract XML data is best called;

n Take a variety of measures to prevent SQL injection; use parameterized queries, use views, assign SELECT permissions to the table, limit the permissions of the database login role, etc.

The above is something written at any time at any time during the actual development process, and I will remember to make a supplement correction.

转载请注明原文地址:https://www.9cbs.com/read-125442.html

New Post(0)